MAX

MAX

Top  Previous  Next

 

The MAX field qualifier keyword causes a field to be reported together with its maximum value.

 

 

Format

 

MAX field {field.qualifiers}

 

where

 

fieldis the field or evaluated expression to be displayed.

 

field.qualifiers are other field qualifying keywords

 

 

The MAX field qualifier keyword is placed before the field name to which it applies and causes the query processor to report the value of the field for each record processed and also to report the maximum value at the end of the report. Used with breakpoints, the MAX keyword will also report the maximum value of the field at each breakpoint.

 

If the field is defined as multivalued, the MAX keyword operates on each value in turn.

 

The MAX keyword operates on all types of data. Where the field holds non-numeric data, a string comparison is performed.

 

 

Used with the SHOW verb, the MAX keyword specifies the maximum number of records allowed in the resultant select list.

 

 

Example

 

The command

 

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

 

would produce a display such as that below in which the maximum value of the VALUE field is repeated at the end of the report.

 

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

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

74529    £1712.43  J McTavish

74273      £95.23  County Newspapers

63940     £141.00  R Bryant

74993       £9.29  Write Right Stationery

        ========

        £1712.43

4 records listed.