You can use the Grouping and Sorting dialog box to arrange query results in a particular order.

 

To sort query results in descending order of a specific field

 

1.Click the Grouping & Sorting toolbar_icon_field_group_sort button on the toolbar.

2.In the first row of the Field/Expression column, select a value from the drop-down list.

3.In the first row of the Sort Order column, select Descending from the drop-down list.

4.Click the Run Query toolbar_icon_run_query button on the toolbar.

 

To sort query results in ascending order of a specific field

 

1.Click the Grouping & Sorting toolbar_icon_field_group_sort button on the toolbar.

2.In the first row of the Field/Expression column, select a value from the drop-down list.

3.In the first row of the Sort Order column, select Ascending from the drop-down list.

4.Click the Run Query toolbar_icon_run_query button on the toolbar.

 

Additionally, you can use a combination of ascending and descending selections on fields to sort your query results. For example, the following query:

 

query

 

initially shows these results:

 

query_results_1

 

If, however, you configure the Grouping and Sorting dialog box to appear as such:

 

grouping_sorting_dialog

 

your query results will look like this:

 

query_results_2

 

The CategoryID column is sorted in descending order (from highest to lowest numbers). Then, when one or more records contain the same value for CategoryID, the OrderNumber column is sorted in ascending order (lowest to highest numbers).

 

To delete a row from the Grouping & Sorting options

 

1.Right-click the row you want to delete.

2.Click Delete Row.

3.In the Delete Confirmation dialog box, click Yes.

 

To insert a row into the Grouping & Sorting options

 

1.Right-click the row below the point where you want to insert a row.

2.Click Insert Row.

 

To move a row up in the Grouping & Sorting options

 

1.Right-click the row you want to move up.

2.Click Move Up.

 

To move a row down in the Grouping & Sorting options

 

1.Right-click the row you want to move down.

2.Click Move Down.