How to limit Query return to first 10 that satisfy criteria

  • Thread starter Thread starter kennedyr4 via AccessMonster.com
  • Start date Start date
K

kennedyr4 via AccessMonster.com

I need to create reports with top 5 and top 10 groups


I can query and sort by size, but how do I return only the top 10?

--
Rob Kennedy
Instructional Technologist
The University of Scranton

Message posted via AccessMonster.com
 
IF you are using the query grid, click on the properties for the query.
Change Top Values from ALL to 10.

This will return ties if the last values are equal based on you sort clause.

In SQL view

SELECT TOP 10 FieldA, FieldB, ...
FROM ...
ORDER BY FieldA Desc, FieldB Desc

If you want exactly ten records returned include the primary key in the
order by clause as your last sort. Or make sure your sort order uniquely
orders the records
 
You suggest "top 5 and top 10 groups" but we don't know if the groups are
created in the query or the report.
 
Back
Top