Link to home
Start Free TrialLog in
Avatar of isaacr25
isaacr25

asked on

Select unique field values

I'm currently using the SQL query attached, but I believe this is giving me unique entire records. How can I modify this query to show me only unique records, but by lastname only.

So if this exists in the table:

lastname    ss
smith           1212
smith           5412

then I only want one smith to show up in the results.
I'm using Access 2000
SELECT DISTINCT FP.lastname, FP.ss
FROM FP
ORDER BY FP.lastname;

Open in new window

Avatar of DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
Flag of United States of America image

How about this:

SELECT Table1.Last AS LastName, First(Table1.First) AS FirstName
FROM Table1
GROUP BY Table1.Last;

mx
ASKER CERTIFIED SOLUTION
Avatar of DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial