TPS_Reports
New Member
- Joined
- Apr 24, 2014
- Messages
- 16
I'm having some issues with getting the code below to work. When there is not a matching invoice on the Upload.Invoice table, I would like to update the Status field of the Unprocessed/Unapproved table to 2 when it is at 7 and the invoice field is not null.
I have tried the below SQL and it is not updating the values that fit the criteria. For my test there should be 4 updates and 0 are being completed. I usually use design view and am not sure where I went wrong in the code.
I have tried the below SQL and it is not updating the values that fit the criteria. For my test there should be 4 updates and 0 are being completed. I usually use design view and am not sure where I went wrong in the code.
Code:
[FONT=Verdana]UPDATE [Table1], [Table2][/FONT][/FONT]
SET [Table1].Status = 2, [Table1].[Resolution Date] = Date()
WHERE (([Table1].Status)=7) AND (([Table1].Invoice) Is Not Null) AND (Not Exists (SELECT * FROM [Table1]
[FONT=Helvetica Neue][FONT=Verdana] WHERE [Table1].Invoice = [Table2].Invoice));[/FONT][/FONT]
Last edited: