Duplicates Query
Here you go:
Please back up or make a full copy (recommended) of your database before you perform this solution:
1. Append ALL records from Table B to Table A using the following steps:
a. Select Table B without opening the table
b. Press Ctrl-C for Copy and then press Ctrl-V for Paste
c. In the Paste Table As dialog box, change the Table Name to the exact name (case-sensitive) of Table A
d. Change the Paste Options to: Append Data to Existing Table
e. Click OK (Append action complete)
2. Append ALL records from Table C to Table A using the following steps:
a. Select Table C without opening the table
b. Press Ctrl-C for Copy and then press Ctrl-V for Paste
c. In the Paste Table As dialog box, change the Table Name to the exact name (case-sensitive) of Table A
d. Change the Paste Options to: Append Data to Existing Table
e. Click OK (Append action complete)
3. ALL records should now be in Table A.
4. Make a copy of Table A (Structure Only) and name as MainRecords. This empty table (MainRecords) will be used to paste ALL non-duplicate records during the last step which is ultimately the end-result of what you are trying to achieve
5. Go to your Query Wizard and select Simple Query Wizard.
a. Select Table A and drag ALL Available Fields to Selected Fields box.
b. Click Next and select the Modify the query design radio button
c. Click Finish
6. In your query design view, make the following changes:
a. Click Design on top of the window toolbar and click the Sum Totals button (looks like an oversized sideways M).
1) This action adds the Total row to the bottom of your query screen and;
2) populates the words Group By in the Total row for each selected field
b. Close the query and save the query as the default name
7. Run the query
a. You will now see ALL records in your query with the exception of duplicate records. In other words:
1) Query will not show any record that is an exact duplicate (ALL fields containing the exact data)
2) E.g.: If Table A contains 3 duplicate records, then query will only select 1 of the 3 records and so on.
b. Copy ALL records by highlighting ALL record rows and press Ctrl-C for Copy.
8. Close query
9. Open table MainRecords which should be empty at this point.
a. Final step: Highlight first record row in table MainRecords and press Ctrl-V for Paste
You now have ALL records in the MainRecords table that do not contain duplicate records.
Cheers,
Last edited by P2P4Fam6; December 16th, 2009 at 01:04 AM..
|