Skip to content

DateDiff

Description

DateDiff returns the difference between two dates in the specified unit.

Syntax

DateDiff(start_date, end_date, unit)

Parameters

Parameter Required Type Description
start_date Yes Date, field, or expression Start date.
end_date Yes Date, field, or expression End date.
unit Yes String Return unit, such as "day", "month", or "year".

Notes

Use this function in calculated fields, metric expressions, or query expressions where the function category is supported.

Example

DateDiff(StartDate, EndDate, "day")

The expression returns the calculated result according to the current query context.