Skip to main content

DATEADD

Moves the given date by a specified interval.

Syntax

DATEADD(<date>, <intervals>, <interval>)
ParameterTypeDescription
dateDateA date, or a formula that evaluates to a date value.
intervalsIntegerThe number of intervals to shift.
intervalTextOne of: MINUTE, HOUR, WEEK, DAY, MONTH, QUARTER, YEAR.

Return values

Date

Examples

DATEADD(orders.created_at, 5, HOUR)
DATEADD(orders.created_at, IF(WEEKDAY(orders.created_at) == 6, 1, 0), DAY)