1

I have a simple report and I would like to know how can I convert a number column into time format (hh:mm:ss)?

I have a column (number) that is calculated in mins and I would like to show as time format (hh:mm:ss) in my report instead of whole number.

For example, 45 will show 00:45:00, 65 will show 01:05:00

is there any formula rules in report can do this?

1 Answer 1

2

You can't use formulas in the report to do this, but you can create a custom formula field on the object that you can then add into your report. The formula field would look something like this:

LPAD(TEXT(ROUND(YOUR_NUMERIC_FIELD_NAME / 60, 0)), 2, '0') + ':' + LPAD(TEXT(FLOOR(MOD(YOUR_NUMERIC_FIELD_NAME, 60))), 2, '0') + ':' + LPAD(TEXT(ROUND((YOUR_NUMERIC_FIELD_NAME - FLOOR(YOUR_NUMERIC_FIELD_NAME)) * 60, 0)), 2, '0')

Replace YOUR_NUMERIC_FIELD_NAME with the field name that contains your no. of minutes.

4
  • It doesnt work. It shows:- Error: Invalid custom summary formula definition: Formula result is data type (Text), incompatible with expected data type (Number). Jun 4, 2014 at 1:58
  • I think you will need to create another formula on the object rather than directly in the report.
    – Girbot
    Sep 2, 2014 at 15:02
  • 1) Create a custom field Minutes_as_time__c on the object of type = TEXT, not numeric; 2) Use the field in 1) on your report instead of the numeric field you are using now
    – cropredy
    Oct 3, 2014 at 22:23
  • How to convert duration seconds and display in HH:MM:SS format in text value. @Daniel Hoechst
    – Pavan tej
    Nov 15, 2016 at 6:29

This site is temporarily in read-only mode and not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .