BUSINESS_HOURS_DIFF
Description
Calculates the difference in milliseconds between two Datetime values within business hours. Uses the default schedule if none is provided.
Syntax
BUSINESS_HOURS_DIFF(start_date, end_date, business_hours_name_optional) -> Long
Parameters
| Parameter | Data Type | Required | Description |
|---|---|---|---|
| start_date | Datetime | Yes | The starting Datetime. |
| end_date | Datetime | Yes | The ending Datetime. |
| business_hours_name_optional | String | No | The name of the business hours. |
Examples
BUSINESS_HOURS_DIFF(CreatedDate, ClosedDate)
-- Returns the number of milliseconds between CreatedDate and ClosedDate during default business hours.BUSINESS_HOURS_DIFF(Case_Created__c, First_Response__c, "SupportSchedule")
-- Returns the number of milliseconds between Case_Created__c and First_Response__c during "SupportSchedule" hours.