Deleting dups out of a table or query

C

Crazyhorse

How do you delete the dups out of a table or query? I made a sum query. I
made a Find Dups query off of the sum query. I want to take the dups query
and the sum query join them together and delete out the dups. Is this even
possible?


Thanks
 
A

Allen Browne

You will need to use a subquery, like this:
http://allenbrowne.com/subquery-01.html#DeDuplicate

Naturally enough, your aggregating query is read-only, so you can't use it
to delete records. You also need to tell Access which one of the 2 (or more)
duplicates you want to keep. The subquery example above keeps the one with
the lowest autonumber value.

If that's too messy, a simpler way is to:
a) Create the aggregating query that gives you the un-duplicated values.
b) Use First in the Group By row under any other fields you want to retain
(such as memos.)
c) Turn this into a Make Table query.

After checking that the newly created (de-duplicated) table is right, you
can then delete your old table.
 

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

Similar Threads

Delete dups in a table 3
Count Query 3
Find duplicates query not working..... 2
Delete all but first dup 1
Delete Dups 3
eliminate duplicates 2
Duplicates Query 0
Updateable Query Problem 9

Top