I know that this question could be a basic one. But how can i delete the duplicates from my data. For example
if I have 5 duplicate rows how can I tell access to eliminate 4 of them and keep the 5th.
Thx
Hopefully you have a field that uniquely identify a row, say myID:
DELETE FROM yourTable
WHERE myID Not In (SELECT Max(myID) FROM yourTable GROUP BY dupField1, dupField2, ..., dupFieldn)
Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
DELETE FROM yourTable
WHERE Format([Date],'yyyymmdd') & myID Not In (SELECT Max(Format([Date],'yyyymmdd') & myID) FROM yourTable GROUP BY dupField1, dupField2, ..., dupFieldn)
Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
the query now is
DELETE *
FROM Dup
WHERE Format([FromDate],'mmddyyyy') & IssrNo Not In (SELECT Max(Format([FromDate],'mmddyyyy') & IssrNo ) FROM Dup GROUP BY IssrNo,FromDate,Rtg,ToDate,DefDate );
I have around 58,000 rows and 5 columns in the Dup table. Th query is taking forever to run. Does it make sense? I have a new laptop with 1 geg memory.I am wondering if there is something that could be done regarding the time. After half an hour the run query was still at the begining.
thx
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.