USP_DATALIST_FUNDRAISINGGOAL

Fundraising Goals Associated with a Group

Parameters

Parameter Parameter Type Mode Description
@GROUPID uniqueidentifier IN Input parameter indicating the context ID for the data list.

Definition

Copy


CREATE procedure dbo.USP_DATALIST_FUNDRAISINGGOAL(@GROUPID uniqueidentifier)
as
    set nocount on;

    select ID,
           null PROGRESS, --no longer display progress for fundraiser type goals because of the addition of campaign goals to datalist

           AMOUNT,
           STARTDATE,
           GOALDATE,
           DESCRIPTION,
           KPIINSTANCEID,
           NAME,
           FUNDRAISERTYPE,
           CAMPAIGNID,
           CAMPAIGNNAME,
           BASECURRENCYID
    from dbo.UFN_GROUPGOAL_DATALIST(@GROUPID,'27e07c24-348e-415c-a0ef-db2d89c19e5f')
    where ISFUNDRAISINGGOAL = 1
    order by 
        DATESORT desc,
        Case DATESORT When 1 Then GOALDATE When 0 Then null Else GetDate() - GOALDATE End asc,
        AMOUNT desc

    -- note that the sort order by GOALDATE is as follows:

    -- future dates: from nearest to farthest (e.g., tomorrow comes before 2 days from now)

    -- null dates

    -- past dates: from most recent to least recent