• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 280
  • Last Modified:

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

0
isaacr25
Asked:
isaacr25
  • 2
1 Solution
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
How about this:

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

mx
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
SELECT FP.lastname, First(FP.ss) As MySS
FROM FP
Group By FP.lastname
ORDER BY FP.lastname
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now