Description
Adds a specified unit of time to a date value
Syntax
DATEADD(<datepart>, <number>, <date>)
Arguments
| Argument |
Type |
Description |
Optional |
| datepart |
DateInterval (see definition below) |
Units of measurement to use for the addition |
No |
| number |
Decimal/Integer |
Number of units to be added to date parameter |
No |
| date |
DateTime |
DateTime value to which units are added |
No |
DateInterval
| Value |
Description |
| yy or yyyy |
Year |
| mm or m |
Month |
| d or dd |
Day |
| hh or h |
Hour |
| mi or n |
Minute |
| ss or s |
Second |
Returns
DateTime Value
Examples
| Expression: |
DATEADD("yy", 1, "2014-01-01") |
| Returns: |
2015-01-01 |
| Expression: |
DATEADD("mi", 1, "2013-1-1 10:10") |
| Returns: |
2013-1-1 10:11 |
| Expression: |
DATEADD("dd", 1, "2013-1-1") |
| Returns: |
2013-1-2 |
Download
Download Example