AgileApps Support Wiki Pre Release

DATESUB

From AgileApps Support Wiki
Revision as of 21:52, 27 August 2009 by imported>Evelyn
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The DATESUB function does one of two things:

  • Subtracts a number from a date, datetime, or time variable, and returns a date
  • Subtracts a date, datetime, or time variable from another date, datetime, or time variable, and returns a number
Syntax
 DATESUB('dString', 'dString' or number [,'DAY' or 'MONTH' or 'YEAR' or 'HOUR' or 'MINUTE'])
Return
A date in the format defined by Date Format
An integer representing the number of days
Example
DATESUB('12/06/2010', 2, 'MONTH') = '10/06/2010'
DATESUB('12/06/2010', 2, 'YEAR') = '12/06/2008'
DATESUB('12/06/2010', 2, 'DAY') = '12/04/2010'
DATESUB('12/26/2010', '12/06/2010') = 20


See Date Format for more detail on the parameters used in this function.