date_sub
function
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
Related functions
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for