Deleting records based on records in another table

P

Paul Fenton

I have 2 tables, A & B, the records for which come from 2 separate
queries that created the tables. Now I want to delete from table B,
all the records contained in table A.

I need some help with a query or VBA that will accomplish this. Both
tables contain an ID field that is unique and not duplicated. So if a
record in A with ID 03124 exists in Table B, I want to delete that
record from table B.


Paul Fenton
 
J

John Spencer (MVP)

That should be fairly simple.

Delete TableB.*
FROM TableB INNER JOIN TableA
ON TableB.IDField = TableA.IDField

Are you sure this isn't homework. It seems pretty simple and straightforward.
 

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

Top