Hello everyone, I'm looking for assistance with possibly a simple SQL script.
I currently have the script:
select employid, deducton from upr00500 group by employid, deducton order by employid, sum(sfrfedtx + shfrfica + shfrsttx + sfrlcltx) desc
This returns the results
employid deduction
ACKE0001 INS2
ACKE0001 MED
ACKE0001 401K
ACKE0001 EPU
ACKE0001 NEW
BARB0001 MED
BARB0001 401K
BARB0001 EPU
BARR0001 MED
BARR0001 401K
I need to update a different table (UPR00502) With those values. There is also a field called DEDNSQNC which needs to increment by 1 (starting with 1) and reset when the employid changes. EG
employid deduction dednsqnc
ACKE0001 INS2 1
ACKE0001 MED 2
ACKE0001 401K 3
ACKE0001 EPU 4
ACKE0001 NEW 5
BARB0001 MED 1
BARB0001 401K 2
BARB0001 EPU 3
BARR0001 MED 4
BARR0001 401K 5
Any help or suggestions would be greatly appreciated. Thanks!
I currently have the script:
select employid, deducton from upr00500 group by employid, deducton order by employid, sum(sfrfedtx + shfrfica + shfrsttx + sfrlcltx) desc
This returns the results
employid deduction
ACKE0001 INS2
ACKE0001 MED
ACKE0001 401K
ACKE0001 EPU
ACKE0001 NEW
BARB0001 MED
BARB0001 401K
BARB0001 EPU
BARR0001 MED
BARR0001 401K
I need to update a different table (UPR00502) With those values. There is also a field called DEDNSQNC which needs to increment by 1 (starting with 1) and reset when the employid changes. EG
employid deduction dednsqnc
ACKE0001 INS2 1
ACKE0001 MED 2
ACKE0001 401K 3
ACKE0001 EPU 4
ACKE0001 NEW 5
BARB0001 MED 1
BARB0001 401K 2
BARB0001 EPU 3
BARR0001 MED 4
BARR0001 401K 5
Any help or suggestions would be greatly appreciated. Thanks!