SELECT StudentID, LastName
FROM TheTable
WHERE StudentID in
(SELECT StudentID
FROM (SELECT DISTINCT StudentID, LastName FROM TheTable) as A
GROUP BY StudentID
HAVING Count(*) > 1)
You can do this by building and "stacking" queries
First Query
SELECT DISTINCT StudentID, LastName FROM TheTable
(In the query grid, select unique values and include just the two fields)
second query uses first query.
SELECT StudentID
FROM qOne
GROUP BY StudentID
HAVING Count(StudentID) > 1
(In the query grid, select the first query
-- Add the StudentId field to the query twice
-- Select View Totals
-- Change one GROUP BY to Count
-- Put > 1 as the criteria under Count
Now make a query with your table and the second query. Join studentID to
StudentID and you should get a list of all the students with more than one
last name
--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..