-
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 Lightning Experience – Five Tips for Salespeople
Customer relationship management (CRM) was revolutionized when Salesforce was released. Today, it remains one of the most prominent names in CRM software, primarily because of…
How to Send Email to Salesforce Sales Cloud Data from Marketing Cloud
This blog will tell you how one can fetch Salesforce data from the Sales cloud into the marketing cloud and then use the automation studio…
Popular Salesforce Videos
Data Import: Clean and Prepare Your Data Using Excel | Salesforce
Cleaning and Preparing Data Using Excel covers several features and functions that will make quick work of getting your data files ready for import. Vlookup,…
The 3 Most Common Challenges Associated With B2b Commerce Cloud Implementations
With growing technology businesses are adapting to the new changes. B2B commerce cloud is one of them. But to implement the B2B commerce cloud is…
Manage Packages & Post Installation Script | Salesforce Managed Packages
This video will give you a brief overview of Managed Packages and Unmanaged Packages in Salesforce. You will get a quick glance at how to…