DAYS_BETWEEN
Description
DAYS_BETWEEN
is a row function that calculates time between 2 DATE
values (value1
- value2
) and truncates it to days (accounting for daylight savings).Syntax
DAYS_BETWEEN
(date_1
,date_2
)Return Value
Returns 1 value per row of type
INTEGER
.Input Parameters
- date_1
- Required. A field or expression of typeDATE.
- date_2
- Required. A field or expression of typeDATE.
Examples
Calculate the number of days to ship a product by subtracting the value of the
order_date
field from the ship_date
field:DAYS_BETWEEN([ship_date], [order_date])
Calculate the number of days since a release by subtracting the value of the
release_date
field from the current date (the result of the TODAY
expression):DAYS_BETWEEN(TODAY(), [release_date])