-
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
Salesforce Reshapes AI Pricing Through Agentforce’s Pay-for-Resolution Approach
Salesforce launched Agentforce less than two years ago as a platform designed to help businesses build, deploy, and manage AI agents. Since then, organizations have…
How Salesforce Lightning Can Supercharge Your Marketing Strategy?
Salesforce Lightning is a powerful tool that can greatly enhance your marketing strategy and help you drive business growth and achieve your goals. In today's…
Latest Trends you may have missed about Salesforce Journey Builder and GA 360
Salesforce Journey Builder — In November 2017, Salesforce announced a strategic partnership with Google that brought together two of the world’s leading tech giants. And with deep…
Popular Salesforce Videos
Skills for Salesforce Field Service | Optimize Customer Service for Businesses | Salesforce Webinar
One way to optimize customer service operations is by having the right technician for the right job. How? Skills for Salesforce Field Service is the…
Tableau CRM for Emergency Response Management | Salesforce
When disaster strikes, public and private health organizations, as well as government agencies, need to respond quickly and efficiently. Tableau CRM for Emergency Response Management…
Video calling in Salesforce using WebRTC
Enhance your contact center offering by integrating WebRTC video calling directly into Salesforce Service Cloud. This video will guide you in understanding how you can…