|
![]()
Deleting Duplicate Records from a TableInstead of using the Access wizard to detect duplicates, the best way of doing this is to create a query that selects the unique records from the table, and then turn this into a make-table query. Start by creating a new query, and adding the table that has the data in. Add all of the fields to the query grid (either by adding the individually, or by adding the asterisk, which means 'All Fields'). Change the query's Unique Values property to yes (note that Unique Records might appear to work, but won't if the records are only coming from one table), and when you run the query, you will only see the unique values being shown. Now convert this into a Make-Table query, and when you run it, you will have a table that has no duplicates in. The final SQL will look something like:
The above SQL selects all of the fields from tblOne, tblTwo, and tblThree. If you have different numbers of fields in the tables, or the fields are in a different order, then you will need to specify the fields as required:
One of the advantages of using the UNION query like this is that by default, it removes duplicates automatically for you. Once you have this query created, you can then create a Make-Table query based on this to give you the unique data that you require.
Copyright & Disclaimer | Last modified at 06/06/2006 15:00:05 | ||||||||||||||||