DateAdd
The DateAdd function adds a specified quantity of time to a date.
For more information (including use case exercises) about date functions, see the Common Date Functions and Use Cases QuickStart.
Syntax
DateAdd(unit, amount, date)
Function arguments:
- unit (required) - the unit of time to add (i.e., year, quarter, month, week, day, hour, minute, or second)
- amount (required) - the number of units to add
- date (required) - the date or column containing date values the function adds time to
When a decimal is entered in the amount argument, the function rounds the input to the nearest integer.
Examples
DateAdd("minute", 60, Date("1999-12-31 23:00:00"))
- Adds 60 minutes to the specified data and returns
2000-01-01 00:00:00
.
DateAdd(“day”, 7, [Date])
- Adds 7 days to every date in the Date column.
DateAdd(“year”, -1, [Date])
- Subtracts 1 year to every date in the Date column