Office 2010 - Access

Lesson 26: Sorting Queries

26/76 Lessons 

Sort

One way to sort ascending or descending fields in a “Query” is by clicking the downward pointing arrow button, beside the column title. This opens a drop-down menu where you have the choice of sorting descending or ascending.

les26_image001_en
A second way to sort data in a “Query” is in “Design view.”

The third row in the grid is the “Sort” order row.

When you click in a cell on this row, a drop-down menu with the options “Ascending”, “Descending” and “not sorted” are shown.

In this example, I choose the “Last Name” field to sort “Ascending” and the “Score” “Descending”.

les26_image002_en

When you sort on multiple columns in “Design view”, it sorts from left to right.
This means that “Access” will sort first on the “Last Name” and within these records, “Access” will sort the “score” descending.

Click the “Run” button in the “Ribbon” to see the result.

les26_image003_en
If you want to save the “Query”, click the “Save” button in the “Ribbon” and give it an appropriate name.

Show Highest values

In “Access”, we have the option to display the highest values from the “Query”. Under the “Design” contextual tab In the “Ribbon”, we have a drop-down menu.

Click on the drop-down arrow next to the “Result” box. Select an option from the drop-down menu, or type your own value in the textbox (1).

les26_image004_en
Then choose the sorting order of the fields.

Choose “Descending” (2) or “Ascending” in the drop-down menu. “Descending” gives you the highest values and “Ascending” gives you the lowest values.

les26_image005_en
Because I want to see the top 3 of the highest scores, I choose “Descending”.
To see the result, I click the “Run” button in the “Ribbon”.

les26_image006_en

Awesome!
You've completed Lesson 26
START NEXT LESSON