-
Hours between two date time formula showing negative values in Salesforce
I have written a formula to calculate the difference between two Date/Time fields,
Please find the formula`ROUND(24*(
(5*FLOOR((DATEVALUE(First_Response__c)-DATE(1996,01,01))/7) +
MIN(5,
MOD(DATEVALUE(First_Response__c)-DATE(1996,01,01), 7) +
MIN(1, 24/24*(MOD(First_Response__c-DATETIMEVALUE('1996-01-01 12:00:00'), 1)))
))
-
(5*FLOOR((DATEVALUE(CreatedDate)-DATE(1996,01,01))/7) +
MIN(5,
MOD(DATEVALUE(CreatedDate)-DATE(1996,01,01), 7) +
MIN(1, 24/24*(MOD(CreatedDate-DATETIMEVALUE('1996-01-01 12:00:00'), 1)))
))
), 2)Here I have a case whose created date is 12/12/2016 2:16AM and Firstresponse date is 12/12/2016 10:54 AM now the case response hour formula field shows me the difference between the above as -15.37 .
I tried to calculate the difference between two date Time for 24 hours not for a business hours, I only want to exclude weekends,
The hour calculation should be from 12:00 AM today to 11:59 PM the next day.
Please advise
Log In to reply.
Popular Salesforce Blogs
How Can Salesforce CRM Boost its Sales Revenue?
Salesforce is a CRM that puts sales at the center of its operation. Salesforce has the capacity to do it just right, from acquiring precise…
Transforming Customer Engagement with Salesforce Experience Cloud: Best Practices
With high customer expectations in today's digital world, businesses must be at the forefront of customer engagement strategies. Salesforce Experience Cloud is the key to…
How to Communicate Between Two Salesforce Lightning Component Using Attributes?
How to communicate between two Salesforce Lightning Components using attributes? Communication between the two Salesforce Lightning Components simply means the transfer of data from the…
Popular Salesforce Videos
How I Really Feel About Salesforce
A deep dive into the state of the Salesforce industry in 2021, such as: - Is Salesforce going to crash in the foreseeable future? -…
Salesforce Macros - All You Need To Know!
Macros in Salesforce allows you to perform repetitive actions in Service Cloud for the records of Account, Contact, Case, and Lead (Supported for Feed based…
Dynamic Report Charts & Customer 360 View in Salesforce - Learn Salesforce Series By Algoworks
In this video, the following points will be covered - 1. Introduction Introduction to conventional setup for Customer 360. 2. Prerequisites Setting up a base…