Delegate - End Date Delegate for Inactive Delegates
To end date the delegat if assigned to inactive users
To end date the delegat if assigned to inactive users
Update delegates set enddate=SYSDATE(), updatedate=SYSDATE(), updateuser=1 where delegatekey in (
select * from(
(select delegatekey from delegates d left join users u on d.userkey = u.userkey where u.statuskey=0 and d.enddate > sysdate()
UNION select delegatekey from delegates d left join users u on d.delegateuserkey = u.userkey where u.statuskey=0 and d.enddate > sysdate()) ) )
Comments
Post a Comment