DateDiff


 

DateDiff>date1,date2,interval,result[,direction]

 

Returns the difference between two dates.  Interval can be one of:

 

D: Days

W: Weeks

M: Months

Y: Years

 

The dates must be in local system format. Use DateLocal to generate a date in local system format.

 

The optional parameter direction takes a variable which will be set to 'later' if date2 is later than date1 or 'earlier' if date2 is earlier than date1.

 

See also: DateAdd, DateLocal, DatePart

 

Example:

 

GetDate>today

DateAdd>today,M,1,NextMonth

 

DateDiff>today,NextMonth,D,numberDays