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.

vb4me

Programmer
Nov 27, 2001
48
0
0
US
Hello,

I have a make table query that gathers info from a table and makes a temp table that I alter and then append back to the original table.

The problem is that once I have appended data back into the original table it duplicates the value - EmpID that I am querying on to create the temp table.

This would be fine if there was a way for me to only show the records once for each employee.

So what I need to do is after I have created the temp table how can I delete any duplicate empID values. A query would be fine - I can create a query with the wizard to find duplicate values but then how do I delete all but one of these values - if I turn the find duplicate query into a delete query it deletes them all.

I cannot do the MS suggested way of cutting and pasting etc and having no dupicates in the new table as I want it automated.

Any ideas would be appreciated.
 
Only thing I can think of is to write VBA code that will append each record at a time.
Loop at the new records in the temp table then you could run a query in the loop and check to see if the record exists.
Delete the old record and append the new.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top