Using MS Access, can I run multiple UPDATE statements in one SQL query?
Say I have a table with columns A-F. What I want to do is this:
UPDATE table SET C = NULL WHERE C = 0
UPDATE table SET D = NULL WHERE D = 0
UPDATE table SET E = NULL WHERE E = 0
I understand that with SQL Server I could use a 'GO' after each line but that doesn't seem to work with Access. Is there an alternative, or do I just have to run a load of separate queries?
UPDATE table SET
C=IIF(C=0,NULL,C),
D=IIF(D=0,NULL,D),
E=IIF(E=0,NULL,E)
WHERE
C=0 OR D=0 OR E=0
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With