Max

Max function returns the maximum value out of a set of expressions. Will be an aggregate if one parameter will only look at first row if value2 is entered.

Syntax :

Max(Expression,[Value2])
Parameters Description
Expression The first value or range to consider when calculating the maximum value.
[Value2] [OPTIONAL] - Additional values or ranges to consider when calculating the maximum value.

Examples :

Table Name : Products

ProductID Product Name Price
1 Pen 6
2 Pencil 3
3 Eraser 2
4 Bottle 5
5 Book 10

Example 1

dMax = Max(Price)
DEBUG(dMax)

Result :

dMax
= 10

Example 2

dMax = MAX(10,5) 
DEBUG(dMax)

Result :

dMax
= 10