Delete query

  • Thread starter Thread starter Gargamil
  • Start date Start date
G

Gargamil

I have a simple select query which returns all the records of a table which
I want to keep. Now delete queries remove everything that matches the
criteria defined in the query. How do I delete everything that DOESN'T
match the selected criteria??
The select query returns all records that have matching records in another
table. I'm looking to remove all those records that do not have matching
records in the other table. Any clues??
 
SELECT * FROM tblTwo
WHERE (((tblTwo.MatchField) Not In (select MatchField from tblOne)));

gives you all records in tblTwo that have a value in MatchField with no
matching value in the field MatchField in table tblOne.

Doug
 
Legend.

user said:
SELECT * FROM tblTwo
WHERE (((tblTwo.MatchField) Not In (select MatchField from tblOne)));

gives you all records in tblTwo that have a value in MatchField with no
matching value in the field MatchField in table tblOne.

Doug
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top