By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,395 Members | 1,382 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,395 IT Pros & Developers. It's quick & easy.

Limit Number of Returned Records per Name

P: n/a
Hi All,

I have a query in access that has multiple records for each person.
The query is currently sorted by year then by name. No person has
records in more than one year.

What I would like to do is return only the first 5 records from each
name. Some names may have less and some more.

Any ideas on how to do this? I know that in SQL I can use the "SELECT
TOP 5" etc, however I think this would require a different query for
each person which would then have to be unioned.

Any help is appreciated, Thanks!!

Aug 16 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Can you post your simplified table structure with some sample data and
the output you need? Also you need to tell is what 'first' means in the
context of your data, (youngest, oldest etc)
andrewbda wrote:
Hi All,

I have a query in access that has multiple records for each person.
The query is currently sorted by year then by name. No person has
records in more than one year.

What I would like to do is return only the first 5 records from each
name. Some names may have less and some more.

Any ideas on how to do this? I know that in SQL I can use the "SELECT
TOP 5" etc, however I think this would require a different query for
each person which would then have to be unioned.

Any help is appreciated, Thanks!!
Aug 16 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.