|
Previous Top Next |
Prototype: | (Date pDate, Long pPeriods, Byte pDatePart=1),Long |
pDate | Base date for the calculations. |
pPeriods | Number of period units to add. This number can be positive or negative |
pDatePart | Indicates what type of unit to use. Can be IT_Days, IT_Weeks, IT_Months or IT_Years. Defaults to IT_Days. |
Returns | The date calculated by adding pPeriods of pDatePart units to the pDate. |
This method adds - or subtracts - a specified number of period units from the pDate base date. This method is basically the same as the DateAdd method, but different parameter order.
Example:
ITD ITDateClass
FD Date
Code
FD = Date(7,1,2010)
ITD.ODS('GetDate = ' & Format(ITD.GetDate(FD, -3, IT_Months),@D18)) !! Apr 1, 2010
ITD.ODS('GetDate = ' & Format(ITD.GetDate(FD, 3, IT_Months),@D18)) !! Oct 1, 2010
ITD.ODS('GetDate = ' & Format(ITD.GetDate(FD,-10, IT_Months),@D18)) !! Sep 1, 2009
See also: