"Delete" issue

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Performing a Delete query, I link 2 tables that have the same unique
information; example record 123 and record 123. I want to delete matching
data from ONE table, but leave in the other. When I run the DELETE, an
message box will appear and ask me to specify which table to delete from. I
have the correct table selected, but it will not perform.
I have worked around this in the past, by updating the items I want deleted
with a "flag", and then doing a separate delete query.
There has to be a better way!! Any suggestions?
 
Hi PattyD,
Please try it on a TEST MDB before actually do it on the really MDB.

I have another way, for example if you Table Original and Copy. They have
identical fields on both tables. You want to delete the record from Copy
that you already have in Original. If both table have ID 123, you want 123
delete from Table Copy. This query will do it for you.

delete from Copy.ID
where Copy.ID in (select Original.ID from Original);

This will remove all the records in Table Copy that have the same ID in both
tables.

Hope this helps.
 
Back
Top