Code:
UPDATE
jt
SET
jt.Assigneduser = (SELECT u.userid FROM Users u where u.username ='Debbie Ross')
FROM
Jobstasks jt
Users u on jt.assigneduser = u.userid
Funds f on jt.fundid = f.fundid
Jobs j on jt.procindex = j.procindex
Tasks t on jt.taskindex = t.taskindex
WHERE
j.jobdescription = 'UnderWriting - Insurance Submission'
and (
T.Taskdescription = 'Review/Check Documents for Assessment'
or jt.tasksequence = 2
)
and f.dbcode = 'FBRPW'
and f.subfund = 'FBRP'
and (u.username = 'Debbie Ross'
or jt.assigneduser is NULL)
and jt.inactivejobtask = 'N';
Comment