Sorting rows

You can sort the data, but any sort criteria you define are for testing only and are not saved with the table or passed to the DataWindow painter.

Figure 16-11: Specifying sort criteria in the Database painter

Shown is the Specify Sort Columns dialog box. It has a listing labeled source data containing available columns in the selected tables of the Database painter. Two columns, dept i d and state, have been dragged to a separate Columns listing at the right of the dialog box, indicating that these columns will be used to sort the data. Check marks next to these two column listings indicate that the sort will be in ascending order for both columns.

The order in which the columns display in the Columns box determines the precedence of the sorting. For example, in the preceding dialog box, rows will be sorted by department ID. Within department ID, rows will be sorted by state.

StepsTo sort the rows:

  1. Select Rows>Sort from the menu bar.

    The Specify Sort Columns dialog box displays.

  2. Drag the columns you want to sort on from the Source Data box to the Columns box:

    A check box with a check mark in it displays under the Ascending heading to indicate that the values will be sorted in ascending order. To sort in descending order, clear the check box.

  3. Change the sort order precedence by dragging the column names in the Column box to achieve the sort order you want.

  4. (Optional) Double-click an item in the Columns box to specify an expression to sort on.

    The Modify Expression dialog box displays.

  5. Specify the expression.

    For example, if you have two columns, Revenues and Expenses, you can sort on the expression Revenues – Expenses.

  6. Click OK.

    You return to the Specify Sort Columns dialog with the expression displayed.

    NoteIf you change your mind You can remove a column or expression from the sorting specification by simply dragging it and releasing it outside the Columns box.

  7. When you have specified all the sort columns and expressions, click OK.