I have a table with a list of people ([FirstName], [Surname], [Age]). Some of these people are in the same family. I'd like to return a list of people who have another family member in the table (same surname). However I'd like to exclude records that have no other records with the same surname. Whats the best way to do this in MS Access

Select [FirstName], [Surname], [Age]
From People
Where DCount("Surname", "People", "Surname='" & SurName & "'") > 1


Select P.*
From (Select Surname From People Group by Surname Having Count(*) > 1) AS G
JOIN People AS P ON P.Surname = G.Surname

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.