CasewareDocs

GetMaxValue

Delivers the maximum value of a numeric, date or time field.

Compatibility

Available as of IDEA version 10.0

Syntax

GetMaxValue(database as Variant, fieldName as String)

Parameters

database

Database name including the path(if needed). The file extension is not necessary. Alternatively the current database object can be provided.

fieldName

Name of the field to extract the maximum value from.

Return Value

Maximum value of the given numeric, date or time field.

Depending on the corresponding field data type the return values are provided as double, date or time value.

Remarks

If the function is used for a text, boolean or multistate field an exception will be thrown.

This function does not support a default value.

In case the underlying database is missing an exception shall be thrown. The same is valid in case the field does not exist.

Because IDEA is not supporting NULL values some results are treated specifically.

IDEA values are interpreted as NULL when

  • a table has no records
  • a field only contains erroneous data
  • a date field provides date entry which consists only of zeros.

In case of a NULL numeric or time value (seconds since midnight) this function delivers zero(0).

In case of a NULL date value this function delivers 9999-12-31 as date value.

The developer has to check at least against the date return value to get a proper result.