Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fetching top 5 distinct records 1

Status
Not open for further replies.

evergreean43

Technical User
May 25, 2006
165
US
I currently have a query where I use distinct to fetch distinct lastnames from my Access 2000 database:

Code:
select distinct lastname, firstname from user;

Now I need to just fetch the top 5 but it gives me error when I do it:
Code:
select top 5, distinct lastname, firstname from user;

Please advise.
 
From the Query Design screen, I get:
[tt]SELECT DISTINCT TOP 5 user.lastname, user.firstname
FROM [user];[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top