Page 2 of 11PREVNEXT

Queries III: Use expressions and other criteria

Creating a top-values query


One of the most common querying tasks is finding the most or least of something. For example, you may need to know who had the most sales last quarter, or which student has the lowest grades. You can do that with a top-values query. You can also retrieve a specific number of records, such as your 10 best sellers, or a percentage of records, such as the students in the bottom 25 percent of the class.

Callout 1 Open your query in Design view. To do that, go to the Navigation Pane, and under Queries, right-click the query and click Design View.
Callout 2 On the Design tab, in the Query Setup group, open the Return list and select a value, or enter a value of your own. You can enter numbers or percentages.
Callout 3 In the design grid, click the Sort row, open the list, and select a sort order. The sort order tells the query to return either the top or bottom values. To see low values, such as the bottom 25 percent of monthly sales, sort in Ascending order. To see high values, sort in Descending Order. If that seems a bit confusing, it will make more sense during the practice.
Callout 4 Test your changes. On the Design tab, in the Results group, click Run.

Next, let's go deeper into selection criteria.

Page 2 of 11PREVNEXT