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

Deleting Duplicates from a Table

Status
Not open for further replies.

ITProg

Programmer
Nov 9, 2004
43
US
I have 2 tables: tblReviews and tblHistory. At the end of the month data from tblReviews will be appended to tblHistory. At the time that I append the data to tblHistory I would also like to make sure there are no duplicate records in tblHistory. tblHistory can have more than one record for a person, but should not have more than one record for that person for the same date. Since the data is not being deleted from tblReviews when it is appended, it is a possiblity that there could be duplicate records that should not be added to tblHistory. I am using an autonumber field as the primary key in tblHistory. tblReviews has a staffno as the primary key.
 
Why not make the primary key in tblHistory a combination of fields for person name(or id) and date. Then when tblReviews appends it would not append duplicate values.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top