DAYS ER function

The DAYS function returns an Integer value that represents the number of days between one specified date and a second specified date.

Syntax

DAYS (date 1, date 2) as Integer

Arguments

date 1: Date

A date value that represents the start date for the calculation of the number of days.

date 2: Date

A date value that represents the end date for the calculation of the number of days.

Return values

Integer

The resulting numeric value.

Usage notes

The DAYS function returns a positive value when the first date is later than the second date, it returns 0 (zero) when the first date equals the second date, and it returns a negative value when the first date is earlier than the second date.

Example

DAYS (TODAY (), DATEVALUE( DATETIMEFORMAT( ADDDAYS ( NOW(), 1), "yyyyMMdd"), "yyyyMMdd")) returns -1.

Additional resources

Date and time functions