-
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
The Importance of Salesforce Support for Businesses
Are you looking to boost your sales team's performance and streamline your business operations? Salesforce is here to help! In today's competitive market, having a…
How to Boost Your Business with a Salesforce Partner Company?
Are you looking to take your business to the next level? If so, consider leveraging the power of Salesforce, one of the world's leading customer…
Transforming Field Service Operations by Leveraging Technology and The Salesforce Ecosystem
Field Service is a critical functional area for any industry that needs to physically move goods or personnel; essentially involving inventory management, fleet management, and…
Popular Salesforce Videos
Salesforce Certification Training | Salesforce Training Videos for Beginners
This Salesforce Administrator & App Builder certification Training course is designed to ensure that you learn & master the concepts of Salesforce Administrator & App…
Salesforce Financial Services Cloud Spring '23 Highlights
Shake off those winter blues with the new features coming in Salesforce's Spring '23 Release for Financial Services Cloud. Whether it's ARC enhancements, interaction summary…
Welcome to an all-digital, work-from-anywhere world | Salesforce Customer 360 | Salesforce Anywhere
Welcome to an all-digital, work-from-anywhere world. With Salesforce Customer 360, Salesforce can connect your teams, delight your customers, and grow your business together. Take the…