Page History
...
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.
Valid types for period are:
SECONDS
MINUTES
HOURS
DAYS
WEEKS
MONTHS
YEARS
Syntax
Code Block |
---|
WORKINGDAYS BETWEEN date1startDate AND date2WORKINGDAYSendDate WORKINGDAYS_BETWEEN ( date1startDate, date2endDate, 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 DAYOFWEEK Date and Time functions [9.6] function, e.g. Sunday = 1, Monday = 2 etc.
UI Text Box | ||
---|---|---|
| ||
You can use the periods | ||
UI Text Box | ||
| ||
The order in which the dates are placed is irrelevant. The order in which the dates are placed is irrelevant. |
Return type
integer
UI Text Box | ||
---|---|---|
| ||
If you prefer a functional syntax, you can call these methods as: |
Examples
Examples
WORKINGDAYS BETWEEN DATE( 2015 , 1 , 1 ) AND DATE( 2015 , 2 , 1 )
= 22WORKINGDAYS_BETWEEN ( DATE ( 2015
DAYS BETWEEN DATE( 2010 , 1 , 1 )
AND , DATE (
2010 , 2 , 1 ) = 312015 , 2 , 1 ) , [ 3, 4, 5, 6, 7 ] )
= 23 (work week Tuesday - Saterday)WORKINGDAYS
DAYS_BETWEEN ( DATE ( 2010 2015 , 1 , 1 ) , DATE ( 2010 2015 , 2 , 1 ) ) = 31
, [ 2, 3, 4, 5 ] )
= 17 (4 day work week Monday - Thursday)DAYS BETWEEN DATE( 2010 , 5 , 31 ) AND DATETIME ( 2010 , 6 , 1 , 12 , 0 , 0 ) = 1
, since 1 day and 12 hours have elapsedDAYS BETWEEN DATETIME ( 2010 , 1 , 1 , 14 , 0 , 0 ) AND DATETIME ( 2010 , 1 , 2 , 13 , 0 , 0 ) = 0
, for only 23 hours have elapsed
DAYS BETWEEN DATE ( 2010 , 5 , 31 ) AND DATE ( 2010 , 6 , 1 ) = 1
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 hours have elapsed
Include Page | ||||
---|---|---|---|---|
|
...