Question : Delete duplicate records

Hi,

I need to delete duplicate records from the following table "QuotesFile"
I have only to keep one record based on the max date of the "dateuploaded field"
Please, see the following example and xls attached
QuoteNumber    IID         CreateConvert      DateUploaded
A11222315      101327      1      14-Aug-09
A11222315      242106      1      28-Aug-09

The code below will delete all 218 records and  Ineed to keep one from one of each quote.
Code Snippet:
1:
2:
3:
4:
Delete QuotesFile.[Quote Number], QuotesFile.[Create Convert], QuotesFile.DateUploaded
FROM QuotesFile
WHERE (((QuotesFile.[Quote Number]) In (SELECT [Quote Number] FROM [QuotesFile] As Tmp GROUP BY [Quote Number] HAVING Count(*)>1 )))
ORDER BY QuotesFile.[Quote Number];

Answer : Delete duplicate records

I think that the proposed solution should work fine. Try is with a copy of your DB and let us know how you go
Random Solutions  
 
programming4us programming4us