Skip to main content
Version: 7.9

maxDate

This function is used by Ignition's Expression language.

Description

Finds and returns the maximum date in the given column of the given dataset, or the max value in a series of dates specified as arguments. When looking up the max date in a dataset, the column may be specified as an index or as a column name. Any null values in the column are ignored. If there are no rows in the dataset, null is returned.

Syntax

maxDate(dataset, columnIndex)

  • Parameters

    • DataSet dataset - The starting dataset to search.

    • int columnIndex - The index of the column to search for the max date. Must be a column index of the provided dataset.

  • Returns

    • Date - The maximum date of the given date column in the given dataset.

Syntax

maxDate(dataset, columnName)

  • Parameters

    • DataSet dataset - The starting dataset to search.

    • string columnName - The name of the column to search for the max date. Must match a column name in the provided dataset.

  • Returns

    • Date - The maximum date of the given date column in the given dataset.

Syntax

maxDate(date[, date])

  • Parameters

    • Date date - A date. Can be as many dates as needed.
  • Returns

    • Date - The maximum date of the given dates.

Examples

The following table applies to the code snippet below:

AlarmTimePathSeverity
2010-01-08 7:28:04Tanks/Tank5/TempHiAlarm4
2010-01-08 10:13:22Tanks/Tank38/LoLevel2
2010-01-08 13:02:56Valves/Valve2/2
Code Snippet
maxDate({Root Container.Table.data}, "AlarmTime") //You could use this expression to get the date and time for the most recent alarm.
Code Snippet
maxDate(now(0), addMinutes(now(0), 5)) // This would return the Date that is 5 minutes from now.