Need help with a delete query

greaseman

Closer to seniority!
Local time
Yesterday, 19:16
Joined
Jan 6, 2003
Messages
360
I have two tables..... one table is my "master" table, and the other table is a table of all of the records I want to delete from the "master" table.

I tried setting up a query where I match up the records and then running the query to delete records, but it did not work.

Does anyone out there possibly have a query they could toss my way that uses one table to delete from another table?

Thank you so much!!!!
 
Look at the IN keyword. The general expression is as follows:


Delete From MainTable where MainTable.Key not IN (Select Key from SubTable)
 
mstcyr,

Thanks for your reply! What I ended up doing was writing a Visual Basic snippet of code that took care of what I wanted to do.

However, I will save your suggestion for other times in the future that I'm sure will come up.

Thanks again, and have a great day.
 

Users who are viewing this thread

Back
Top Bottom