Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Applies to:
Databricks SQL
Databricks Runtime
Returns the date numDays before startDate.
Syntax
date_sub(startDate, numDays)
Arguments
startDate: A DATE expression.numDays: An INTEGER expression.
Returns
A DATE.
If numDays is negative abs(num_days) are added to startDate.
If the result date overflows the date range the function raises an error.
Examples
> SELECT date_sub('2016-07-30', 1);
2016-07-29