Max

Description

Determines the larger of two numbers.

Syntax

Max ( x,  y )

Argument

Description

x

The number to which you want to compare y

y

The number to which you want to compare x

Returns

The datatype of x or y, whichever datatype is more precise. If any argument’s value is null, Max returns null.

Usage

If either of the values being compared is null, Max returns null.

Examples

Example 1

This statement returns 7:

Max(4,7)

Example 2

This statement returns -4:

Max(- 4, - 7)

Example 3

This statement returns 8.2, a decimal value:

Max(8.2, 4)

See also