Connecting Tech Pros Worldwide Help | Site Map

Delete Query Access2000

  #1  
Old December 2nd, 2008, 12:55 PM
Newbie
 
Join Date: Dec 2008
Posts: 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));
  #2  
Old December 2nd, 2008, 01:02 PM
Lives Here
 
Join Date: Jul 2008
Location: Maryland
Posts: 1,121
Provided Answers: 18

re: Delete Query Access2000


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
Reply


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to load access as database using ListView (VB6) nhaztieh answers 15 August 21st, 2007 03:38 PM
Dynamically query a table to OpenForm with an Access Database!!! melaine answers 6 November 6th, 2006 11:55 AM
Delete query Simon Harris answers 1 November 13th, 2005 06:08 AM
Delete recordsets with same Date and Line Julia Härtfelder via SQLMonster.com answers 3 July 23rd, 2005 10:04 AM