If you would like to upgrade to a newer long-term support version of Studio Pro, see Moving from Mendix Studio Pro 8 to 9.

OQL DATEDIFF

Last modified: August 27, 2024

The DATEDIFF function returns the difference between two given date/time values. The difference is given in the specified unit.

The syntax is as follows:

DATEDIFF ( unit , startdate_expression, enddate_expression )

unit

Specifies the unit of the date/time value to retrieve. This can be one of the following:

YEAR, QUARTER, MONTH, DAY, WEEK, HOUR, MINUTE or SECOND.

startdate_expression Specifies the startdate of the period being calculated. This should be formatted in an expression which resolves to a date/time value.

enddate_expression Specifies the enddate of the period being calculated. This should be formatted in an expression which resolves to a date/time value.