Delete Dups

S

Sherry

I have used the Find Dups Query and now I want to delete the second, third,
etc. occurence of the dup record so I only have one. How would I attempt to
do this?
 
C

ChrisJ

one way is to create an identical table, and use an append query to move all
records to the new table. The query would need "Group by" turned on for all
fields except i guess for the primary key which would need the max, min,
first or last setting.
 
S

Sherry

Chris, Thanks for your reply. I tried all kinds of variations of this and
cannot get it to work. Can you give me an example or be more specific?
 
C

ChrisJ

Sure.
To create a new table: In the database window, select your exiting table,
copy it and then paste it back into the same window. Select the dialog box
"structure only", and select a new name.

Now to the query:
Create a new query based on the old table. Select all the fields
individually with the exception of the primary key field(s).
Turn on the "totals" function. This will preset all fields to "Group By".
Run the query.
I suspect that you will still get what you would consider duplicate records,
but which Access doesn't. Take a group of these records that you consider
duplicate and compare them field by field until you find a difference. You
then need to tell access which of the group you want it to use by chaning the
totals function for that field to something other than "group by" (min, max,
sum, first, last etc).
If you can't formulate a set of rules to return exactly the records you
need, then you may have to weed out the unwanteds by hand.

If you can get the query to your liking, turn it into an append query and
fill your new table.
I
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top