Compares two numbers (or two date, character, or logical expressions) and returns the greater value.

Syntax

MAX(<exp1>, <exp2>)

<exp1>

A numeric, date, character, or logical expression to compare to a second expression of the same type.

<exp2>

The second expression to compare to <exp1>.

Description

Use MAX( ) to compare two numbers to determine the greater of the two values. You can use MAX( ) to ensure that a number is not less than a particular limit.

MAX( ) may also be used to compare two dates, character strings, or logical values, in which case MAX( ) returns:

The later of the two dates. In dBASE Plus, a blank date is considered later than a non-blank date.

The character string with the higher collation value. Collation values are determined by the language driver in use, and are case-sensitive. For example, with the DB437US driver, the letter "B" is higher than the letter "A", but "a" is higher than "B" (all lowercase letters are collated higher than uppercase letters).

true if one or both logical expressions evaluate to true. (The logical OR operator has the same effect.)

If <exp1> and <exp2> are equal, MAX( ) returns their value.