Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Duplicate Records

Status
Not open for further replies.

Dickx

Technical User
Aug 24, 2001
33
US
Access has a query function to find duplicate records in a table, but is it possible to automatically delete the 2nd occurance of duplicates ?
 
Provided you have an autonumber field as your ID this should work:

DELETE From TblX
WHERE TblX.ID not in (SELECT MIN(ID) from TblX group by Field1, Field2, Field3...)

in query designer you can place the where clause (starting with not in) in the criteria field under 'ID'

You could always add the unique ID field, delete your dupes, and then remove it.

HTH,

Alex

It's a magical time of year in Philadelphia. Eagles training camp marks the end of another brutal season of complaining about the Phillies.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top