www.icetips.com  Icetips Utilities Documentation 11/14/2010    

Date Class: DateAdd

Previous  Top  Next  


Prototype: (Byte pDatePart=1, Long pNumber, Date pStartDate),Long

 

pDatePartIndicates what type of unit to use.  Can be IT_Days, IT_Weeks, IT_Months or IT_Years.  Defaults to IT_Days.
pNumberNumber of units to add.  This number can be positive or negative
pStartDateBase date for the calculations.

 

ReturnsThe 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:

DateDiff

GetDate

 



Direct link to this page: http://www.icetips.com/manuals/utilities/dateadd_dateclass.htm