USP_DATALIST_GROUPGOAL

Group 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_GROUPGOAL(@GROUPID uniqueidentifier)
as
    set nocount on;

    select ID,
           PROGRESS,
           TYPE,
           cast(AMOUNT as int) AMOUNT,
           STARTDATE,
           GOALDATE,
           DESCRIPTION,
           KPIINSTANCEID,
           NAME
    from dbo.UFN_GROUPGOAL_DATALIST(@GROUPID, '66fbc33d-a791-4234-a3e6-28bab397ca70')
    where ISFUNDRAISINGGOAL = 0
    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