AgileApps Support Wiki Pre Release

DATECOMP

From AgileApps Support Wiki
Revision as of 23:16, 15 December 2010 by imported>Alice (Updated examples per case 2010-11-06-16531)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The DATECOMP function compares two given dates, datetimes, or times and returns:

  • For two given dates or datetimes, the difference in days
  • For two given times, the difference in minutes


Syntax
DATECOMP(dString, dString)

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

If the first argument is of type time, only hour or minute are allowed as the last argument.

Return
Number
Example
DATECOMP('04/15/2010', '04/05/2010') = 10
DATECOMP('04/05/2010', '04/15/2010') = -10
DATECOMP(TODAY(), '04/05/2010') = 10 when TODAY is 04/15/2010 
DATECOMP(TODAY(), Closed_Date) = 10 when TODAY is 04/15/2010 and Closed_Date is 04/05/2010
DATECOMP('04/15/2010 10:15 am', '04/05/2010 1:15 am') = 10
DATECOMP('10:23 PM', '2:52 AM') = 1171.0
DATECOMP('10:23 AM', '2:52 PM') = -269.0