If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Unanswered: Deleting like records

I have a user that has 2 databases. #1 has apx. 20,000 records. #2 has apx. 1000 records that are identical to records in #1.
What he wants to do is to delete all records in #1 that match records in #2.
All records in both tables are unique so matching just one or two fields should suffice.
Can this be done using a delete query? and if so how do I implement this query. Caution, I am really a greenhorn here!
Any help would be appreciated.

Create a new query in design view. Add Table1 and Table2. Join the related fields between the 2 files. Double-click the * in Table1 (the table you are deleting from). It should now appear in your grid. Change your Query Type to a Delete Query. You can do this by clicking on the Query Type button in the toolbar. You should now have a Row titled "Delete" in your grid with a value of 'From' for the first column. You can click the 1st button in the Toolbar to see what you are going to delete. Return to Design View and click the button with the ! in order to run the query.

Create a new query in design view. Add Table1 and Table2. Join the related fields between the 2 files. Double-click the * in Table1 (the table you are deleting from). It should now appear in your grid. Change your Query Type to a Delete Query. You can do this by clicking on the Query Type button in the toolbar. You should now have a Row titled "Delete" in your grid with a value of 'From' for the first column. You can click the 1st button in the Toolbar to see what you are going to delete. Return to Design View and click the button with the ! in order to run the query.

TD

This produces a SQL line very similar to what I had and with the same result: