CCNC/CCNC Module 5/Retrieving data with queries/Basic Query Operations/Sorting Data

From WikiEducator
Jump to: navigation, search
Tutorial.png Basic Query Operations 

Retrieving Data | Using Query Filters | Sorting Data | Using the Query Wizard | Self Assessment | Summary & FAQs

Sorting Data

Icon objectives.jpg


Upon completion of this tutorial the learner will be able to:
  • Sort data
  • Execute simple ascending and descending sorts
  • Create a sort using parameters

Simple Sorting

Figure 1. Opening a Table

Data can be sorted according to numeric or alphabetical order. To sort data open the table to be sorted.


On the table toolbar there are three buttons that can be used for sorting. These are;

  1. Sort Order - which opens the Sort Order dialog.
  2. Sort Ascending - which sorts the records A to Z or if numbers, lowest to highest.
  3. Sort Descending - which sorts the records Z to A or if numbers, highest to lowest.


Press this button to sort all the records for the selected column in an ascending order


Press this button to sort all the records for the selected column in an descending order

Opening the Sort Dialog

Figure 5. The Sort Button

To create a more advanced sort that uses more than one column within the sort click the Sort button on the toolbar. This will present the "Sort Order" dialog.

Figure 6. The sort parameters

The Sort Order dialog allows a sort to be created with up to three fields using either an ascending or descending order. After choosing the sort fields and the order click OK to run the sort, the table should then be sorted based upon the sort order entered. (Remember: to remove the sort order, use the "Remove Filter / Sort" button on the toolbar.)

Test your knowledge

Icon qmark.gif



1. An Ascending sort order has numbers ordered from highest to lowest?

Incorrect, An Ascending sort order has numbers ordered from lowest to highest. Click here to review the topic.
Absolutely Correct!

Your score is 0 / 0