BY

BY

Top  Previous  Next

 

The BY sort clause keyword causes the query processor to sort records prior to display or when building a select list.

 

 

Format

 

BY {NO.CASE} field

 

where

 

fieldis the field name or evaluated expression to be used to determine the sort order.

 

 

The BY keyword causes records to be sorted into ascending order of the specified field. The comparison is performed before conversion of the data to its display format. If the display format is left justified, a left justified sort is performed. Conversely, if the display format is right justified, a right justified sort is performed.

 

The optional NO.CASE keyword causes the sort to be performed in a case insensitive manner. Effectively, all comparisons are done using an uppercase version of the data being compared. Use of the QUERY.SORT.NO.CASE setting of the OPTION command implies the NO.CASE qualifier.

 

If more than one sort clause is present, sort criteria are applied in the order in which they are specified.

 

The command

 

LIST BOOKS BY @ID

 

is identical to

 

SORT BOOKS

 

 

Example

 

The command

 

LIST INVOICES VALUE CUSTOMER.NAME WITH NO AMT.PAID BY VALUE

 

would produce a display such as that below.

 

LIST INVOICES VALUE CUSTOMER.NAME WITH NO AMT.PAID BY VALUE

Invoice  ...Value  Customer...................

74993       £9.29  Write Right Stationery

74273      £95.23  County Newspapers

63940     £141.00  R Bryant

74529    £1712.43  J McTavish

4 records listed.

 

 

See also:

BY.DSND, BY.EXP, BY.EXP.DSND