Zum Hauptinhalt gehen

One to Many DataLinks in Feature Description

Kommentare

1 Kommentar

  • Permanently deleted user
    Not that I have found. One method however is to make use of contenation of multple results in SQL . ie rather than using a datalink that returns n records, use a datalink that returns 1 record made from n records.

     

    for example the follow SELECT gets the property rates history as one record.

     

    -- --------------------

     

    SELECT        ValNum,dbo.fn_GIS_ConcatRatesHistory(ValNum) AS RatesHistory, SUE FROM            dbo.tbl_GIS_Sue_Valuation

     

    WHERE        (CancelDate IS NULL)

     

    -- -------------------- 

     

    CREATE FUNCTION [dbo].[fn_GIS_ConcatRatesCvHistory](@ValNum varchar(20))

     

    RETURNS VARCHAR(8000)

     

    AS

     

    BEGIN

     

    DECLARE @CvValues VARCHAR(8000)  

     

    SELECT @CvValues = COALESCE( @CvValues + char(13), '') +

     

                        ' ' + isnull(convert(nvarchar(4),Asm_Yr) + ': $' + convert(nvarchar(20),CV) ,'') + ' '

     

    FROM (select RT_ASM_ID1 + '*' + RT_ASM_ID2 + '*' + RT_ASM_ID3 + '*' + isnull(RT_ASM_ID4,'')  as ValNum

     

            ,RT_ASM_CAPVAL as CV

     

            ,RT_ASM_ID6 as Asm_Yr

     

             from RT_ASSESSMENT) as derivedTbl

     

    where ValNum = @ValNum

     

     order by ValNum,Asm_Yr desc

     

     RETURN @CvValues

     

    END

     

    -- --------------------

     

    Possibly not the most robust or most perfect solution but it works.

     

    Try a web search for information about methods for concatenating records.

     

    Regards

     

    Ralph Price
    0

Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.