Possible Duplicate Records

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a query that lists possible duplicates for a phone number. Let's say two individuals live in the same household and have the same phone number

I've setup a field in the table to indicate whether this is valid information. i.e. verified etc

Let's say a user enter's another record with the same phone number.

I want to the query to provide me with that new entry as a possible duplicate to the first two entries. However if the field indicates verified then the query should return 0 rows. i.e. there would need be three records that would indicate that would would be flagged as true entries and not a possible keying error etc

Can anyone please advise on what the criteria should be in the query.

Thank You
 
The following query should get all non-verified records that have a duplicate
phone number. Substitute your field and tablenames.

SELECT PhoneRecords.*
FROM PhoneRecords
WHERE Verified = False
AND PhoneNumber In (
SELECT PhoneNumber
FROM PhoneRecords
GROUP BY PhoneNumber
HAVING Count(PhoneNumber) > 1)
 
Back
Top