Using QMF

Order by more than one column

To order by more than one column, put AO(1). under the column to be ordered first. Then, put AO(2). under the next most significant column, and so on.

The number following AO. indicates the sort priority. The sequence of sort priorities you use need not be complete. For example, you can use 1, 2, and 4 without using 3, but no two columns can have the same priority.

The following query sorts by job first (in ascending order). Then, within each job classification, it sorts the rows by years of employment (in ascending order).

When you run this query:



Q.STAFF | NAME | DEPT | JOB       | YEARS     |
--------+------+------+-----------+-----------|
        | P.   | 84   | P. AO(1). | P. AO(2). |

QMF produces this report:

NAME       JOB    YEARS
---------  -----  -----
GAFNEY     CLERK      5
QUILL      MGR       10
DAVIS      SALES      5
EDWARDS    SALES      7

You can only sort on columns that the query selects. If you use AO. in some row and column of an example table, you must use P. either in the same row and column, or in the same row under the table name (which displays every column).


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]