Deleting records based on records in another table

  • Thread starter Thread starter Paul Fenton
  • Start date Start date
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
 
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.
 
Back
Top