Hello,
I normally create a VB program to interact with SQL, however, in this case I am trying to avoid creating a program and wondering if it's possible to do this directly in SQL and if so, what code would work.
I want to update one field in one table based on another field in that same table. Here is some pseudo code of what I am trying to accomplish:
As mentioned I normally do not program directly in SQL, however any help would be greatly appreciated.
If at first you don't succeed, then sky diving wasn't meant for you!
I normally create a VB program to interact with SQL, however, in this case I am trying to avoid creating a program and wondering if it's possible to do this directly in SQL and if so, what code would work.
I want to update one field in one table based on another field in that same table. Here is some pseudo code of what I am trying to accomplish:
Code:
"SELECT EMPLOYEE, DISTCODE FROM UPEMPD WHERE EARNDED = 'REG' ORDER BY EMPLOYEE"
Loop
"SELECT EARNDED, DISTCODE FROM UPEMPD WHERE EMPLOYEE = (employee from first SQL)"
Loop
SELECT CASE UPEMPD.Fields("EARNDED")
CASE "CALL", ...
UPEMPD.Fields("DISTCODE") = (distcode from first SQL)
UPEMPD.Update
END SELECT
End loop
End loop
As mentioned I normally do not program directly in SQL, however any help would be greatly appreciated.
If at first you don't succeed, then sky diving wasn't meant for you!