UFN_AGINGBUCKET_PERIODLISTXML

Get an xml list of the aging period buckets for a module

Return

Return Type
xml

Parameters

Parameter Parameter Type Mode Description
@APPLICATIONCODE tinyint IN

Definition

Copy


        create function dbo.UFN_AGINGBUCKET_PERIODLISTXML
            (
                @APPLICATIONCODE tinyint
            )
        returns xml
        with execute as caller
        as begin
            declare @XML xml
            set @XML = (
            select ID, PERIODNUMBER, PERIODSTART, 
            case when  PERIODEND = 32767  then 'over' else CAST(PERIODEND as nvarchar(10)) end as 'PERIODEND'
            PERIODDESCRIPTION 
            from dbo.AGINGBUCKET
            where APPLICATIONCODE = @APPLICATIONCODE 
            order by PERIODNUMBER
            for xml raw('ITEM'), type, elements, root('AGINGBUCKETAPXML'), BINARY BASE64)
            return @XML
        end