Getting started
User guides
Administration guides
Reference guides
Resources
Updated Aug 04, 2022
Send us feedback
date_sub
Returns the date numDays before startDate.
numDays
startDate
date_sub(startDate, numDays)
startDate: A DATE expression.
numDays: An INTEGER expression.
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.
> SELECT date_sub('2016-07-30', 1); 2016-07-29
date_add function
date_from_unix_date function
datediff function
months_between function
timestampadd function