Max()

<< Click to Display Table of Contents >>

Navigation:  Available Functions >

Max()

Syntax

Max( <NumericValue1>, <NumericValue2> )

Max( <DateValue1>, <DateValue2> )

 

Purpose

To return the larger of two values.

 

Parameters

This function will determine the larger of two values. These values may be of either numeric, or date type. This function will only work with one type of value at a time. You can not give it a date and numeric value together to compare.

 

Returns

This function will return either a numeric, or a date value depending on what it is given to compare. If this function is asked to compare two numeric values, it will return the larger of the two numeric values. If asked to compare two date values, it will return the larger (most recent) of the two date values.

 

Usage

The Max() is useful when you wish to determine the larger of two numeric or date values. For example, say you want to print a report with a column you just invented which contains the greater of the two previous years of giving. To do this you would enter:

 

Max( .Donation_Total_For_Calandar_Year_1_Year_Ago., .Donation_Total_For_Calandar_Year_2_Years_Ago. )

 

...for the report column's Field Name/Expression.