UFN_CONSTITUENT_ISFORMERBOARDMEMBER
This functions returns whether a constituent had a board member constituency in the past.
Return
| Return Type |
|---|
| bit |
Parameters
| Parameter | Parameter Type | Mode | Description |
|---|---|---|---|
| @CONSTITUENTID | uniqueidentifier | IN |
Definition
Copy
CREATE function dbo.UFN_CONSTITUENT_ISFORMERBOARDMEMBER(@CONSTITUENTID uniqueidentifier)
returns bit
with execute as caller
as begin
declare @CURRENTDATE date;
set @CURRENTDATE = getdate();
if exists(
select
ID
from
dbo.BOARDMEMBERDATERANGE
where
BOARDMEMBERDATERANGE.CONSTITUENTID = @CONSTITUENTID and
(BOARDMEMBERDATERANGE.DATETO < @CURRENTDATE)
) return 1;
return 0;
end