UFN_GROUP_GETINCOMPLETEEVENTTASKCOUNT
Returns the number of incomplete event tasks for a group and event.
Return
Return Type |
---|
int |
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@EVENTID | uniqueidentifier | IN | |
@GROUPID | uniqueidentifier | IN |
Definition
Copy
create function dbo.UFN_GROUP_GETINCOMPLETEEVENTTASKCOUNT(@EVENTID uniqueidentifier, @GROUPID uniqueidentifier) returns integer with execute as caller
as
begin
declare @CNT integer;
select @CNT = count(distinct EVENTTASK.ID)
from dbo.EVENTTASK
left outer join dbo.GROUPMEMBER
on EVENTTASK.OWNERID = GROUPMEMBER.MEMBERID
where EVENTTASK.EVENTID = @EVENTID and EVENTTASK.STATUSCODE <> 1 and
(EVENTTASK.OWNERID = @GROUPID
or
(GROUPMEMBER.GROUPID = @GROUPID and dbo.UFN_GROUPMEMBER_ISCURRENTMEMBER(GROUPMEMBER.ID) = 1))
return coalesce(@CNT, 0);
end