function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Hugo_BHugo_B 

How to calculate the difference between 2 date/time fields

I would like to calculate the time between 2 datetime fields to provide me with a result in hours.  The dates could be more than a day apart (ie. maybe the difference is 103 hours)

 

I would like to put it in a trigger that updates a field on Cases.

 

Any help appreciated.

sai.sfsai.sf

create a formula field which calculates the difference between two custom fields as :  ((test_1__c - test__c)*24) where test_1__c and test__c are two custom date/time fields