Monday, September 24, 2018

Get the Difference of Two Dates with a Result in Days Hours Minutes Format in a Saved Search


Image

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 sub tab, 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.


Note:
When replacing standard fields with custom fields, make sure that the format is Date not Date/Time

No comments:

Post a Comment