Tuesday 15 January 2019

Microsoft Access The Basics – Sorting a Table

Sorting a table 

Data is stored in the table in the primary key order as default (See Primary Key page 26).  If you want to view the data in some other order then it has to be sorted in that way.

To sort on one field 

1. Select a field that is to control the sort order

2. Click on the appropriate button to sort in Ascending or Descending order.



To sort on more than one field 


Sometimes the data has to be sorted on more than one field when there are matches on the main sort.

For instance if the customers are sorted by country, then as there are probably several customers in each country then you might want to sort the customers further either by customer name or by city.  In this case the Country would be the main sort, and then customer name or city would be the secondary sort.

Depending on the amount of data involved, you can sort the data by as many fields as you want.  (The maximum number allowed is the number of fields in the table minus one).

The sort on multiple fields is carried out in reverse order, with the first sort carried out on the secondary field first and then the primary field if there are to be two fields that the sort is carried out on.  If there are to be three sorts, then the first sort would be on the tertiary field first.

1. Select the secondary field
.
2. Click on the appropriate button to sort in Ascending or Descending order

3. Select the primary field.

4. Click on the appropriate button to sort in Ascending or Descending order.

No comments:

Post a Comment