How Do I Sort & Count Records in a Query in Microsoft Access?
When you create a query in Microsoft Access, you are asking a question of your data based on specific criteria. The result or "answer" that Access gives you is called the return and will be a table containing only the records that fit the bill. Understanding how to use commands like Sort and Count on the return will help you to manage your data more effectively.
Instructions
-
Create and Run Your Query
-
1
From the "Create" tab, click on "Query Design" in the "Other" group. In the "Show Table" dialog box, double-click the table(s) that your query will be based on to bring them onto the design grid.
-
2
Select the fields that you will show in your query by double-clicking the desired field name in each field list box. Each field name appears on the "Field" row.
-
-
3
Type the desired criteria under the applicable field name on the "Criteria" row and click the "Run" button in the "Results" group.
Sort the Return
-
4
Click the "View" button in the "View" group to return to the Query design grid. On the "Sort" row, single click underneath the field that you will be sorting by.
-
5
Single-click the list arrow that appears and then choose "Ascending" to sort from A to Z or "Descending" to sort from Z to A.
-
6
Click the "Run" button in the "Results" group to view the sorted list.
Count the Records
-
7
In the "Records" group, single-click the "Totals" button. This will add a "Totals" row at the bottom of your datasheet.
-
8
Single click on the "Totals" row underneath the column of data that you want to count.
-
9
When the list arrow appears, single-click it and then choose "Count" from the available functions. Depending on the type of data in your datasheet, the available functions may vary. The total number of items should now appear as a result at the bottom of your datasheet.
-
1