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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

what is easiest way to delete duplicate records 2

Status
Not open for further replies.

Rousseau10

Programmer
Feb 22, 2005
242
US
what is easiest way to delete duplicate records?
thanks
 
Easiest is kind of a relative term.

One way is to create a table exactly like the one you have, only without any data. (Copy it, but structure only, not data.)

Then change the design of the table so that the fields that are duplicated are part of the primary key of the new (empty) table.

Then insert all of the rows from the old table into the new table (an Append Query). When you do this, Access will tell you that "x" number of rows were not inserted, due to key violations.
Go ahead and do the insert (answer "YES"), and the new table will not contain any dupes.

That's one way.
Tranman
 
what if the uniquness is 2 fields
claimNo ClaimLineNo



Is this like primary and foreign key, or composit key?
 
Composite Key not allowing duplicates.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top