pmccue
Instructor
- Jul 29, 2006
- 18
How can I delete similar records in Access?
There's the info:
In a large table (~165k reocords) are many occurances of two or more records where the LastName, FirstName, and DOB fields all match, ie, these are not duplicate records where all fields match.
I want to delete similar records, leaving one unique record in the table (unique LastName, FirstName, DOB fields).
Would need an sql example for syntax as all my attempts using sql have so far failed.
IT4EVR suggested the following script, but it hangs when executed on my system:
DELETE *
FROM Table1 AS a
WHERE a.ID NOT IN(SELECT MIN(b.ID) FROM Table1 AS b WHERE a.LastName = b.LastName AND a.FirstName = b.FirstName AND a.DOB=b.DOB);
Is there another method of completing this task?
Thanks,
Phil....
There's the info:
In a large table (~165k reocords) are many occurances of two or more records where the LastName, FirstName, and DOB fields all match, ie, these are not duplicate records where all fields match.
I want to delete similar records, leaving one unique record in the table (unique LastName, FirstName, DOB fields).
Would need an sql example for syntax as all my attempts using sql have so far failed.
IT4EVR suggested the following script, but it hangs when executed on my system:
DELETE *
FROM Table1 AS a
WHERE a.ID NOT IN(SELECT MIN(b.ID) FROM Table1 AS b WHERE a.LastName = b.LastName AND a.FirstName = b.FirstName AND a.DOB=b.DOB);
Is there another method of completing this task?
Thanks,
Phil....