|
Previous Top Next |
Prototype: | (Byte pDatePart=1, Long pNumber, Date pStartDate),Long |
pDatePart | Indicates what type of unit to use. Can be IT_Days, IT_Weeks, IT_Months or IT_Years. Defaults to IT_Days. |
pNumber | Number of units to add. This number can be positive or negative |
pStartDate | Base date for the calculations. |
Returns | The date calculated by adding pNumber of pDatePart units to the pStartDate. |
This method adds or subtracts a set number of units from the base date. The unit can be IT_Days, IT_Weeks, IT_Months or IT_Years.
Example:
ITD ITDateClass
FD Date
Code
FD = Date(7,1,2010)
ITD.ODS('DateAdd = ' & Format(ITD.DateAdd(IT_Months, -3,FD),@D18)) !! April 1, 2010
ITD.ODS('DateAdd = ' & Format(ITD.DateAdd(IT_Months, 3,FD),@D18)) !! October 1, 2010
ITD.ODS('DateAdd = ' & Format(ITD.DateAdd(IT_Months,-10,FD),@D18)) !! September 1, 2009
ITD.ODS('DateAdd = ' & Format(ITD.DateAdd(IT_Months,-24,FD),@D18)) !! July 1, 2008
See also: