date_add
Moves the given date by a specified interval.
Syntax
date_add(<date>, <intervals>, <interval>)
| Parameter | Type | Description |
|---|---|---|
| date | Date | A date, or a formula that evaluates to a date value. |
| intervals | Integer | The number of intervals to shift. |
| interval | Text | One of: MINUTE, HOUR, WEEK, DAY, MONTH, QUARTER, YEAR. |
Return values
Date
Usage
Adds the specified interval to the date.
date_add(orders.created_at, 5, HOUR)
Adds the specified interval to the date.
date_add(orders.created_at, if(weekday(orders.created_at) == 6, 1, 0), DAY)