The DateDiff() function calculates the difference between two dates.

Syntax

DateDiff(start_date, end_date, unit)

Returns

A number that is the difference between two dates in a specific unit. If one of the two dates is unknown then this function returns unknown.

Parameters

  • start_date – a date.
  • end_date – a date.
  • unit – the date unit of which the difference is calculated.

Examples

DateDiff('2014-08-21', '2002-12-31', Year)
/* Returns 11 */

DateDiff('2002-08-21', '2014-12-31', Year)
/* Returns 12 */

DateDiff('2002-08-21', '2014-12-31', Month)
/* Returns 148 */

 +31 (0)20 240 21 20       

Videos and images courtesy of WEM Modeler. © 2019. WEM Modeler.
SitemapPrivacy - Terms - Company

 +31 (0)20 240 21 20       


Videos and images courtesy of WEM Modeler.
© 2019 WEM Modeler.
SitemapPrivacy - Terms - Company