0

I am trying to display the duration in this format: 05:02:09 which is hour, minute and second.

At the moment I can display it without the leading zero in this format: 5:02:09

=IIF(
 Fields!DataValue.Value < 0, 0,
  Floor(Fields!DataValue.Value / 3600) &":"&Format(
    DateAdd("s",IIF(Fields!DataValue.Value < 0, 0, Fields!DataValue.Value),"00:00"),
    "mm:ss"
  )
)

How can add a leading zero when the hour is less than 10?

enter image description here

eMRe
  • 3,097
  • 5
  • 34
  • 51

1 Answers1

0

I found a solution, which I tried before but failed. Strangely, it worked this time.

=IIF(
 Fields!DataValue.Value < 0, 0,
  Format(Floor(Fields!DataValue.Value / 3600), "00") &":"&Format(
    DateAdd("s",IIF(Fields!DataValue.Value < 0, 0, Fields!DataValue.Value),"00:00"),
    "mm:ss"
  )
)
eMRe
  • 3,097
  • 5
  • 34
  • 51