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

Query to remove duplicate lines 1

Status
Not open for further replies.

mnl

Technical User
Apr 9, 2001
1
US
I have a table that contains several fields. The fields are name, ssn, date, field a, and field b. Each line is duplicated, except in the second line field a and field b are always zero. The lines with these zero values are the ones I want to erase. The one quirk is that sometimes on the first line (the one I want to keep) the values are also zero in field a and field b so I can't just run a query to erase all lines were field a and field b are zero. Any suggestions--please and thank you.
 
In general, you would use the standard (wizzard generated) "FInd Dups" query to Identify the duplicate records and then PROGRAMATICALLY remove all except the First / Last one of them. I sww no reason this would not be applicable here, with the exception of sorting by FieldA and FieldB DESC.

MichaelRed
mred@att.net

There is never time to do it right but there is always time to do it over
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top