By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,264 Members | 1,087 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,264 IT Pros & Developers. It's quick & easy.

Delete Query Access2000

P: 1
Help, i'm new to this.
I'm trying to run a delete query in Access 2000 and the error message i get is: 'Could not delete from specified tables'

I want to delete ProductMaster.[PART NO] that does not exist in [FINAL MASTER].[PART NO], what have i done wrong?


The SQL for the query is:
SELECT ProductMaster.*, [FINAL MASTER].[PART NO]
FROM [FINAL MASTER] RIGHT JOIN ProductMaster ON [FINAL MASTER].[PART NO] = ProductMaster.[PART NO]
WHERE ((([FINAL MASTER].[PART NO]) Is Null));
Dec 2 '08 #1
Share this Question
Share on Google+
1 Reply


Expert 100+
P: 1,287
Try something like this:
DELETE * FROM ProductMaster WHERE NOT EXISTS (SELECT Part_No FROM FinalMaster WHERE ProductMaster.Part_No = FinalMaster.Part_No)

EXISTS examples:
SQL: EXISTS Condition
Dec 2 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.