Versions Compared

Key

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

WORKINGDAYS BETWEEN

WORKINGDAYS_BETWEEN


Calculates the working days between two date or dateTime objects. It returns the number of full working days between two dates or dateTimes. 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 )



Inputs
  • 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 DAYOFWEEK function, e.g. Sunday = 1, Monday = 2 etc.

Info

The order in which the dates are placed is irrelevant.YEARS  WORKINGDAYS_BETWEEN date1 AND date2 = YEARS WORKINDAYS_BETWEEN date2 AND date1. Also note that the time component of a datetime value is ignored, similar to the DAYS BETWEEN function.

Return type

  • integer


Examples

ExpressionResultTypeNote
WORKINGDAYS BETWEEN DATE( 2015 , 1 , 1 ) AND DATE( 2015 , 2 , 1 )22Integer
WORKINGDAYS_BETWEEN ( DATE ( 2015 , 1 , 1 ) , DATE ( 2015 , 2 , 1 ) , [ 3, 4, 5, 6, 7 ] )23IntegerWork week Tuesday - Saturday
WORKINGDAYS_BETWEEN ( DATE ( 2015 , 1 , 1 ) , DATE ( 2015 , 2 , 1 ) , [ 2, 3, 4, 5 ] )17Integer4 day work week Monday - Thursday

WORKINGDAYS BETWEEN DATE ( 2015 , 6 , 1 )

AND DATETIME ( 2015 , 6 , 2 , 12 , 0 , 0 )

1IntegerTime is ignored

WORKINGDAYS BETWEEN DATETIME ( 2015 , 5 , 29, 12 , 0 , 0 )

AND DATE ( 2015 , 5 , 31 )

1Integer

Time is ignored

30-5 and 31-5 are Saturday and Sunday

Back to top

...