UFN_REVENUELETTER_CURRENTCOUNT
Returns a count of current revenue letters with the passed in revenue, letter, and constituent IDs.
Return
| Return Type |
|---|
| int |
Parameters
| Parameter | Parameter Type | Mode | Description |
|---|---|---|---|
| @REVENUEID | uniqueidentifier | IN | |
| @LETTERCODEID | uniqueidentifier | IN | |
| @ACKNOWLEDGEEID | uniqueidentifier | IN | |
| @OUTOFDATE | bit | IN |
Definition
Copy
CREATE function dbo.UFN_REVENUELETTER_CURRENTCOUNT
(
@REVENUEID uniqueidentifier,
@LETTERCODEID uniqueidentifier,
@ACKNOWLEDGEEID uniqueidentifier,
-- Including OUTOFDATE since it seems to be needed to trigger
-- checking the table constraint
@OUTOFDATE bit
)
returns int
as
begin
declare @COUNT int
select @COUNT = count(*)
from dbo.REVENUELETTER
where
REVENUEID = @REVENUEID and
LETTERCODEID = @LETTERCODEID and
ACKNOWLEDGEEID = @ACKNOWLEDGEEID and
OUTOFDATE = 0
return @COUNT
end