DateSubtract Function
DateSubtract (dateTime1 as DateTime, dateTime2 as DateTime, isWorking as Boolean) as Duration
Category: | Date |
Description: | Subtracts two dates or datetime parameters (can be fields) and returns duration value. If IsWorking (optional parameter, default is FALSE) set to TRUE returns only the working duration. |
Supported Context: | FormulaField And BusinessRules |
Parameters: | |
dateTime1 as DateTime | Represents the first date value as a date or reference to a field that will return a date value |
dateTime2 as DateTime | Represents the second date value as a date or reference to a field that will return a date value |
isWorking as Boolean | An optional parameter that allows you to return only work days or calendar days. Enter a value of "TRUE" for working days, or "FALSE" for total calendar days |
Returned value as Duration | Returns a duration value equal to the difference between the two dates indicated in the "dateTime1" and "dateTime2" parameters |
Example #1 |
Create a duration custom field that will define the buffer a work item has between the committed due date and the planned due date. Set the formula to be: Datesubtract($CommittedDate,$DueDate) |
Tips |
|
Note | Duration = DateTime1 – DateTime2 e.g. DateSubtract(‘19/2/12’, ‘15/2/12’, TRUE) = 4 d |
Related Functions | |
Additional Links |
duration custom field |