1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
|
UPDATE PayrollSummaries
SET PayrollSummaries.SummaryAttribute =
(CASE
WHEN (tabPersons.Id = '924314963') THEN 1
WHEN (tabPersons.Id = '930087512') THEN 2
WHEN (tabPersons.Id = '924663070') THEN 3
WHEN (tabPersons.Id = '927002946') THEN 4
WHEN (tabPersons.Id = '926019131') THEN 5
WHEN (tabPersons.Id = '925673706') THEN 6
WHEN (tabPersons.Id = '929828900') THEN 7
WHEN (tabPersons.Id = '927742160') THEN 8
WHEN (tabPersons.Id = '937703129') THEN 9
WHEN (tabPersons.Id = '936813622') THEN 10
WHEN (tabPersons.Id = '918686770') THEN 11
WHEN (tabPersons.Id = '935271525') THEN 12
WHEN (tabPersons.Id = '933741289') THEN 13
WHEN (tabPersons.Id = '927422516') THEN 14
WHEN (tabPersons.Id = '928625869') THEN 15
WHEN (tabPersons.Id = '928031985') THEN 16
WHEN (tabPersons.Id = '919054582') THEN 17
WHEN (tabPersons.Id = '918619245') THEN 18
WHEN (tabPersons.Id = '916780870') THEN 19
WHEN (tabPersons.Id = '941008697') THEN 20
WHEN (tabPersons.Id = '932270223') THEN 21
WHEN (tabPersons.Id = '935868718') THEN 22
WHEN (tabPersons.Id = '940682757') THEN 23
WHEN (tabPersons.Id = '939883481') THEN 24
WHEN (tabPersons.Id = '938319818') THEN 2
WHEN (tabPersons.Id = '935504560') THEN 2
WHEN (tabPersons.Id = '919492626') THEN 2
WHEN (tabPersons.Id = '931435488') THEN 2
WHEN (tabPersons.Id = '940262410') THEN 2
WHEN (tabPersons.Id = '911557277') THEN 2
WHEN (tabPersons.Id = '925217025') THEN 2
END
)
FROM
PayrollSummaries
INNER JOIN PayrollEvents
ON PayrollSummaries.PayrollSummaryID = PayrollEvents.PayrollSummaryID
INNER JOIN tabPersons
ON PayrollEvents.PersonID = tabPersons.PersonID
where PeriodEndDate >= '2008-12-31' |