All the Questions in this page use the below sample Dataset. It is the Orders Data for a fictitious seller.

Order NumberOrder DateShipping DateProductPrice ($)Profit ($)
000101 Jan 2018 08:30:01 AM03 Jan 2018 11:21:05 AMABC800150
000202 Jan 2018 01:15:25 PM05 Jan 2018 05:30:15 PMXYZ600120
..................

YEARDIFF

SynonymsAGE, AGEINYEARS, AGE_Y
SyntaxYEARDIFF(date1, [date2])
DescriptionComputes the difference in Years between the Arguments.
Argumentsdate1: End Date. If date2 is not specified, this becomes the Start Date and NOW becomes the End Date.
date2: (Optional) Start Date.
Examples
  • YEARDIFF(SHIPPING DATE, ORDER DATE) - Computes the difference between the two Arguments in each Data-Row and returns the Average of that value across all rows.
  • YEARDIFF(NOW, ORDER DATE) - You can use the Keyword NOW to refer to the current Date.
  • YEARDIFF(ORDER DATE) is equivalent to YEARDIFF(NOW, ORDER DATE)

MONTHDIFF

SynonymsAGEINMONTHS, AGE_M
SyntaxMONTHDIFF(date1, [date2])
DescriptionComputes the difference in Months between the Arguments.
Argumentsdate1: End Date. If date2 is not specified, this becomes the Start Date and NOW becomes the End Date.
date2: (Optional) Start Date.
Examples
  • MONTHDIFF(SHIPPING DATE, ORDER DATE) - Computes the difference between the two Arguments in each Data-Row and returns the Average of that value across all rows.
  • MONTHDIFF(NOW, ORDER DATE) - You can use the Keyword NOW to refer to the current Date.
  • MONTHDIFF(ORDER DATE) is equivalent to MONTHDIFF(NOW, ORDER DATE)

WEEKDIFF

SynonymsAGEINWEEKS, AGE_W
SyntaxWEEKDIFF(date1, [date2])
DescriptionComputes the difference in Weeks between the Arguments.
Argumentsdate1: End Date. If date2 is not specified, this becomes the Start Date and NOW becomes the End Date.
date2: (Optional) Start Date.
Examples
  • WEEKDIFF(SHIPPING DATE, ORDER DATE) - Computes the difference between the two Arguments in each Data-Row and returns the Average of that value across all rows.
  • WEEKDIFF(NOW, ORDER DATE) - You can use the Keyword NOW to refer to the current Date.
  • WEEKDIFF(ORDER DATE) is equivalent to WEEKDIFF(NOW, ORDER DATE)

DAYDIFF

SynonymsAGEINDAYS, AGE_D
SyntaxDAYDIFF(date1, [date2])
DescriptionComputes the difference in Days between the Arguments.
Argumentsdate1: End Date. If date2 is not specified, this becomes the Start Date and NOW becomes the End Date.
date2: (Optional) Start Date.
Examples
  • DAYDIFF(SHIPPING DATE, ORDER DATE) - Computes the difference between the two Arguments in each Data-Row and returns the Average of that value across all rows.
  • DAYDIFF(NOW, ORDER DATE) - You can use the Keyword NOW to refer to the current Date.
  • DAYDIFF(ORDER DATE) is equivalent to DAYDIFF(NOW, ORDER DATE)

HOURDIFF

SynonymsAGEINHOURS, AGE_H
SyntaxHOURDIFF(date1, [date2])
DescriptionComputes the difference in Hours between the Arguments.
Argumentsdate1: End Date. If date2 is not specified, this becomes the Start Date and NOW becomes the End Date.
date2: (Optional) Start Date.
Examples
  • HOURDIFF(SHIPPING DATE, ORDER DATE) - Computes the difference between the two Arguments in each Data-Row and returns the Average of that value across all rows.
  • HOURDIFF(NOW, ORDER DATE) - You can use the Keyword NOW to refer to the current Date.
  • HOURDIFF(ORDER DATE) is equivalent to HOURDIFF(NOW, ORDER DATE)