Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding Duplicates

Status
Not open for further replies.

cranebill

IS-IT--Management
Jan 4, 2002
1,113
US
Ok I am looking for a way to find duplicat phone numbers in a Table....

This SQL was generated By Access and works to find the full number (area code etc):

SELECT [Customer Information Table].Phone, [Customer Information Table].[Customer ID], [Customer Information Table].[Customer Name]
FROM [Customer Information Table]
WHERE ((([Customer Information Table].Phone) In (SELECT [Phone] FROM [Customer Information Table] As Tmp GROUP BY [Phone] HAVING Count(*)>1 )))
ORDER BY [Customer Information Table].Phone;


I have been playing with it to try and pull up duplicated of the last 7 numbers( no area code, trying to find duplicate numbers because of area code changes)

I tried usint Right(Phone,7) in various spots but then i get an aggregate function error. Any Ideas?

Bill
 
Have you tried the Find Duplicates Wizard?

Click on Queries, then click New, should pop up with that option above Find Unmatched Query Wizard.

oops, just read your problem again....

are your dashes stored in your table?
If so, i have a quick form that can remove REALLY fast! Parenthesis' and dashes!
 
No its formatted for phone numbers and only has numbers... no symbols :(

Bill
 
Try replacing this part of the SQL

WHERE ((([Customer Information Table].Phone) In (SELECT [Phone] FROM [Customer Information Table] As Tmp GROUP BY [Phone] HAVING Count(*)>1 )))


By


WHERE ((Right([Customer Information Table].Phone),7) In (SELECT Right([Phone],7) FROM [Customer Information Table] As Tmp GROUP BY Right([Phone],7) HAVING Count(*)>1 )))


Best of luck

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top