fatherofthree
MIS
I am trying to update a field in a table with the value of a field in another table. One of the criterias set is where a value in a totally different table is in one of a list of codes. The code I created is below.
The problem I am having is the update is happening on all accounts no matter what the T.STATUS_CODE value is. Am I missing something in my code?
Thanks
Chad
Code:
UPDATE DOCSADD SET DOCSADD.RET_NAME = (SELECT SETDATA.COMPANY FROM SETDATA WHERE SETDATA.TYPE = '3' AND SETDATA.AP_NUM = DOCSADD.AP_NUM) WHERE EXISTS (SELECT 1 FROM T, DOCSADD, SETDATA WHERE T.STATUS_CODE IN('1','2','3','5','6','7','10','13','14','15','18','19','20','21','22','23','24','25','26','27','28','29') AND T.AP_NUM = DOCSADD.AP_NUM AND T.AP_NUM = SETDATA.AP_NUM)
The problem I am having is the update is happening on all accounts no matter what the T.STATUS_CODE value is. Am I missing something in my code?
Thanks
Chad