calworkdays( start_datetime, end_datetime, calendar_name )
This returns the actual number of work days between two Date and Times (both inclusive), according to the calendar defined for the system.
Keyword | Type | Description |
---|---|---|
|
Date and Time |
The starting Date and Time. |
|
Date and Time |
The ending Date and Time. |
|
Text |
This optional parameter accepts the name of a system calendar; otherwise, the default calendar is used. |
Integer
Passing a calendar name allows you to count working days using an alternate system calendar, if you have multiple calendars configured.
See also: Process Calendar Settings
calworkdays(datetime(2011,12,13,12,0,0),datetime(2011,12,20,12,0,0))
returns 6
If you want to calculate the total number of days in between two dates (including weekends, holidays, and other designated non-working days) you don't need to use this function. Simply subtract date 1 from date 2, as in the following example:
1
pv!date2-pv!date1
Feature | Compatibility | Note |
---|---|---|
Portals | Incompatible | |
Offline Mobile | Incompatible | |
Sync-Time Custom Record Fields | Compatible | Can be used to create a custom record field that only evaluates at sync time. |
Real-Time Custom Record Fields | Incompatible | Custom record fields that evaluate in real time must be configured using one or more Custom Field functions. |
Process Reports | Compatible | |
Process Events | Compatible |
calworkdays() Function