views:

227

answers:

3

I have a large table that includes a last name and date of birth among other things. I need to write a query that returns only those rows where the last names and dates of birth are equivalent to those in another row of the table.

This a table that contains information about people who have made an application. I want to identify those who have applied more than once.

I can think of a way to do this using set operations but MS Access doesn't seem to implement them.

Thanks for your help.

+1  A: 

MS Access has a built-in query builder wizard for finding duplicates

http://www.databasedev.co.uk/query-wizard.html

DJ
A: 

As mentioned by DJ, Access has a wizard for finding dupes. That wizard uses the HAVING clause. So, if you're saying you want to "do it in SQL", I'd suggest reading up on HAVING.

Adrien
+1  A: 

Is there a possibility that the last name has been slightly miskeyed? Either accidentally or on purpose by the person or where the last name could be spelled differently depending on the persons original language.

If so consider using the Soundex algorithm or the first two or three characters of the first name and last name. If you are going to use the Soundex algorithm I would suggest updating the table first with the value of the Soundex field rather than computing it as you go long.

Tony Toews
I find that the Soundex2 algorithm is much more helpful than the original Soundex because with the latter, the matches are way too loose to be of much use.
David-W-Fenton
I didn't even know about Soundex2. Also I was thinking after I posted that North American may have a lot more variety in last names since Soundex was originally created as an algorithm.
Tony Toews