dateadd (days) function

Returns the date numDays after startDate.

Applies to: check marked yes Databricks SQL preview check marked yes Databricks Runtime 11.3 and above

Syntax

dateadd(startDate, numDays)

Arguments

  • startDate: A DATE expression.

  • numDays: An INTEGER expression.

Returns

A DATE.

If numDays is negative abs(num_days) are subtracted from startDate.

If the result date overflows the date range the function raises an error.

To add units other than days use dateadd(unit, value, expr).

This function is a synonym for date_add.

Examples

> SELECT dateadd('2016-07-30', 1);
 2016-07-31