UFN_RECOGNITIONLEVEL_GETPLANNEDGIFTAMOUNTBYDATE
Returns the planned gift amount for the recognition level on the given date.
Return
Return Type |
---|
money |
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@RECOGNITIONLEVELID | uniqueidentifier | IN | |
@DATE | datetime | IN |
Definition
Copy
create function dbo.UFN_RECOGNITIONLEVEL_GETPLANNEDGIFTAMOUNTBYDATE
(
@RECOGNITIONLEVELID uniqueidentifier,
@DATE datetime
) returns money
with execute as caller
as begin
declare @AMOUNT money;
select top 1 @AMOUNT = PLANNEDGIFTAMOUNT
from dbo.RECOGNITIONLEVELAMOUNT
where RECOGNITIONLEVELID = @RECOGNITIONLEVELID
and coalesce(ACTIVEDATE, 0) <= @DATE
order by ACTIVEDATE desc;
return @AMOUNT
end