Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This function calculates the working days between two date or dateTime objects. It returns the number of full working days between two dates or dateTimes, inclusive. The default working days are Monday, Tuesday, Wednesday, Thursday and Friday. This default can be overridden by supplying a list with alternative working days.

Syntax

Code Block
WORKINGDAYS BETWEEN startDate AND endDate
WORKINGDAYS_BETWEEN ( startDate, endDate, workingDays )
  • date1 - The date or dateTime value that represents the start date.

  • date2 - The date or dateTime value that represents the end date.

  • workingDays - A list containing alternative working days. Note that the days should be specified as returned by the Date and Time functions [9.6] function, e.g. Sunday = 1, Monday = 2 etc.

UI Text Box
typenote

The order in which the dates are placed is irrelevant. YEARS BETWEEN date1 AND date2 = YEARS BETWEEN date2 AND date1

Return type

  • integer

Examples

  • WORKINGDAYS BETWEEN DATE( 2015 , 1 , 1 ) AND DATE( 2015 , 2 , 1 ) = 22

  • WORKINGDAYS_BETWEEN ( DATE ( 2015 , 1 , 1 ) , DATE ( 2015 , 2 , 1 ) , [ 3, 4, 5, 6, 7 ] ) = 23 (work week Tuesday - Saterday)

  • WORKINGDAYS_BETWEEN ( DATE ( 2015 , 1 , 1 ) , DATE ( 2015 , 2 , 1 ) , [ 2, 3, 4, 5 ] ) = 17 (4 day work week Monday - Thursday)

  • DAYS WORKINGDAYS BETWEEN DATE ( 2010 2015 , 5 6 , 31 1 ) AND DATETIME ( 2010 2015 , 6 , 1 2 , 12 , 0 , 0 ) = 1, since 1 day and 12 hours have elapsed

  • DAYS WORKINGDAYS BETWEEN DATETIME ( 2010 2015 , 1 5 , 1 29, 14 12 , 0 , 0 ) AND DATETIME DATE ( 2010 2015 , 1 , 2 , 13 , 0 , 0 ) = 0, for only 23 hours have elapsed

  • YEARS BETWEEN DATE ( 2009 , 1 , 1 ) AND DATE ( 2010 , 1 , 1 ) = 1

  • YEARS BETWEEN DATE ( 2010 , 1 , 1 ) AND DATE ( 2020 , 1 , 1 ) = 10

  • YEARS BETWEEN DATE ( 2010 , 1 , 1 ) AND DATE ( 2011 , 5 , 1 ) = 1

  • YEARS BETWEEN DATETIME ( 2010 , 1 , 1 , 12 , 0 , 0 ) AND DATE ( 2011 , 1 , 1 ) = 0, since 364 days and 12 5 , 31 ) = 0, since 12 working hours have elapsed

 

Include Page
_nav_BackToTop
_nav_BackToTop

...