DateDiff
Description
DateDiff returns the difference between two dates in the specified unit.
Syntax
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
The expression returns the calculated result according to the current query context.