Scenario
User needed to get the difference of two dates with a result in days, hours, minutes format in a Saved Search
Solution
To get the difference of two dates with a result in Days/Hours/Minutes format in a saved search, use a formula that computes for the day, hour and minute. The sample below shows a case saved search. To get the format, perform the following steps:
1. Navigate to Lists > Search > Saved Searches > New.
2. Click Case.
3. In the Results tab > Columns subtab, select Formula (Text).
4. In the Formula field, enter the formula below:
TRUNC({closed}-{createddate}) || ' days ' || TRUNC((MOD({closed}-{createddate},TRUNC({closed}-{createddate}))) * 24) || ' hours ' || TRUNC((MOD((MOD({closed}-{createddate},TRUNC({closed}-{createddate}))) * 24,TRUNC((MOD({closed}-{createddate},TRUNC({closed}-{createddate}))) * 24))) * 60) || ' mins'
5. Click Add.
6. Click Save & Run.
Disclaimer
When replacing standard fields with custom fields, make sure that the format is Date not Date/Time