[AccessD] Deleting Duplicates

jwcolby jwcolby at colbyconsulting.com
Sat May 16 08:47:40 CDT 2009


Susan,

It will delete the duplicates.  ALL of them!  And of course you generally want to keep the FIRST 
record of a duplicate set.

John W. Colby
www.ColbyConsulting.com


Susan Harkins wrote:
> Max, Gustav -- I didn't try this, but after running the duplicates wizard, 
> you could open the query in the SQL window and replace SELECT with DELETE, 
> but I can't promise it'll work. I'm sure someone's tried it and will chime 
> in.
> 
> Susan H.
> 
>> Hi Max
>>
>> Yes, from Bill (is he still with us?) on 2001-01-25:
>>
>> <quote>
>> Make sure to make a backup & test it first. . .
>>
>> 1. Add an autonumber field if you don't have a PK.
>> 2. Create a totals Query1 which shows GroupBy the name, and First of the 
>> PK.
>> 3. Create a delete Query2 with the PK criteria like this:
>>
>> Not In (Select FirstOfPK From Query1;)
>>
>> When you run the delete Query2 it will delete everything _except_ the 
>> first
>> occurrence of each name.
> 



More information about the AccessD mailing list