Max
The Max function returns the maximum value out of a set of expressions.
Syntax :
MAX(Expression,[Condition])
| Parameters | Description |
|---|---|
| value | The first value or range to consider when calculating the maximum value. |
| Condition | Optional. |
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(Price, Price<>10)
DEBUG(dMax)
Result :
dMax
= 6