Converting Milliseconds to HH:mm in SSRS2012
I'm very green so please be patient with me but I have a column "duration" in milliseconds and need to convert
the output to hh:mm format. this is in SSRS2012 can anyone help?
February 6th, 2013 3:48pm
Hi Jstrack,
We can use custom code to convert it into hh:mm format.
Public Function Calculate(ByVal TotalSeconds as double) as String
Dim Hours, Minutes, Seconds As Integer
Seconds = Integer.Parse(TotalSeconds/1000)
Hours = floor(Seconds / 3600)
Seconds = Seconds Mod 3600
Minutes =floor( Seconds / 60)
Seconds = Seconds Mod 60
Return Hours.ToString() & ":" & Minutes.ToString()
End Function
Then use the expression to call the custom function.
=Code.Calculate(Fields!Column.Value)
If you have any questions, please feel free to ask.
Regards,Charlie Liao
TechNet Community Support
Free Windows Admin Tool Kit Click here and download it now
February 7th, 2013 4:17am