UFN_FAFEVENT_PARTICIPANTDONORS
Return FAF event participant donors
Return
Return Type |
---|
table |
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@EVENTID | uniqueidentifier | IN | |
@CONSTITUENTID | uniqueidentifier | IN |
Definition
Copy
create function dbo.UFN_FAFEVENT_PARTICIPANTDONORS(
@EVENTID as uniqueidentifier -- FAF event id
,@CONSTITUENTID as uniqueidentifier -- FAF participant constituent id
)
returns table
as
return
SELECT distinct R.CONSTITUENTID
FROM [dbo].[EVENT] (nolock) E
INNER JOIN [dbo].[REVENUE] (nolock) R
ON E.APPEALID = R.APPEALID and E.ID = @EVENTID
and R.ID in (
select RS.REVENUEID from dbo.REVENUESPLIT RS (NOLOCK)
inner join dbo.REVENUERECOGNITION RR (NOLOCK)
on RS.ID = RR.REVENUESPLITID
and RR.CONSTITUENTID = @CONSTITUENTID
AND RS.TYPECODE = 0)