DATE_ADD
Description
DATE_ADD
is a row function that adds the specified time interval to a DATE
value.Syntax
DATE_ADD
(date
,quantity
,"interval
")Return Value
Returns a value of type
DATE
.Input Parameters
- date
- Required. A field name or expression that returns aDATEvalue.
- quantity
- Required. An integer value. To add time intervals, use a positive integer. To subtract time intervals, use a negative integer.
- interval
- Required. One of the following time intervals:
- - Adds the specified number of milliseconds to a date value.millisecond
- - Adds the specified number of seconds to a date value.second
- - Adds the specified number of minutes to a date value.minute
- - Adds the specified number of hours to a date value.hour
- - Adds the specified number of days to a date value.day
- - Adds the specified number of weeks to a date value.week
- - Adds the specified number of months to a date value.month
- - Adds the specified number of quarters to a date value.quarter
- - Adds the specified number of years to a date value.year
- - Adds the specified number of weekyears to a date value.weekyear
Examples
Add 45 days to the value of the
invoice_date
field to calculate the date a payment is due:DATE_ADD([invoice_date], 45, "day")