Randym
1410 pts. | Aug 10 2009 1:26PM GMT
Access has the Find Duplicates Query wizard that can help you build a query to find the duplicates
Meandyou
1840 pts. | Aug 10 2009 2:07PM GMT
here is some SQL to find “duplicate” values (I put quotes around duplicate, because without a unique constraint, the database really does not consider them duplicates)
SELECT COL1, COUNT(*) AS OCCURS
FROM TABLEA
GROUP BY COL1 ;
You might add a WHERE OCCURS > 1 to list only the “duplicates”
Steve
Swd144
20 pts. | Aug 10 2009 4:30PM GMT
Thx for the advice. I did look through and find duplicate values via Excel’s find duplicates, which, I’m sure, was slower than using the Access or SQL find dupes query. In the future, if this happens again, I will keep this in mind.
However, I’m not sure how the dupes got in there in the first place, since I did have the primary key and index set so that it was catching dupes. I learned a big lesson in making backups of my database, even if it isn’t finished.
Meandyou
1840 pts. | Aug 27 2009 4:32PM GMT
You say you are not sure how the dups got there. Well, they got in there while the PK was missing. When the PK was present it prevented the duplicates. then the PK went AWOL and duplicates were no longer rejected.






