DATEADD
Usage
Use this function to increment or decrement Date or Timespan. Available keys for Date are: years, months, days, hours, minutes and seconds. Available keys for Timespan are: days, hours, minutes and seconds. If you want to add a Timespan to a Date you don't have to specify the key.
Category | Function | Type | Where to use | Argument statement |
---|---|---|---|---|
FUNCTION | SERVER ROW | DATE | .VALUE |
Syntax
1 |
|
Arguments
Value_1
Date or Timespan to add Values_2: any date or timespan cell value (#Storage_Name.Field_Name.VALUE
or .OLDVALUE
), System Variables or function-returned date or timespan value
Value_2
Value to add to Value_1: any timespan cell value (#Storage_Name.Field_Name.VALUE
or .OLDVALUE
), constant or function-returned value
Key
For Date: years
, months
, days
, hours
, minutes
, seconds
(not key sensitive)
For Timespan: days
, hours
, minutes
, seconds
(not key sensitive)
Note
If Value_1 or Value_2 are constants, you can use also negative number (-n
) to decrement values
Return Value
Date or Timespan
Examples
Example 1
Formula
=DATEADD("01/01/2020"; 5; months)
Description
Add to the date 01/01/2020, 5 months
Result
01/06/2020
Example 2
Formula
=DATEADD(#StorageExample.Date.VALUE; 5; months)
Description
Add to the cell values of the field date type Date in the StorageExample, 5 months
Result
Date + 5 months
Example 3
Formula
=DATEADD(#StorageExample.Timespan.VALUE; 5; days)
Description
Add to the cell values of the field timespan type Timespan in the StorageExample, 5 days
Result
Timespan + 5 days
Example 4
Formula
=DATEADD(#StorageExample.Date.VALUE; #StorageExample.Timespan.VALUE)
Description
Add to the cell values of the field date type Date in the StorageExample the cell values of the field timespan type Timespan in the StorageExample
Result
Date + Timespan