convert seconds to hh:mm:ss
I have the following value: 124582 seconds that I want to convert to hh:mms in my ssrs report. Fields!Sec_Online.Value/3600 returns.. 34.606111... So I'm looking at over 24 hours.. I found another post that gets me close for anything under 24 hours. When =format(date.FromOAdate((Fields!Sec_Online.Value)/86400), "HH:mms") This returns 10:36:22 Any suggestions?
May 20th, 2008 9:23pm

You're going to have to do some calculations. Possibly use the custom code feature of reporting services. hrs = seconds / 3600leftover = seconds % 3600mins = leftover / 60secs = leftover % 60 Possibly this would work. You might have to play with it a bit. = (Fields!Sec_Online.Value / 3600) & ":" & ((Fields!Sec_Online.Value Mod 3600) / 60) & ":" & ((Fields!Sec_Online.Value Mod 3600) Mod 60)
Free Windows Admin Tool Kit Click here and download it now
May 20th, 2008 10:43pm

I was making this much harder than it had to be!! thanks.
May 20th, 2008 10:58pm

Mavern1ck wrote: I was making this much harder than it had to be!! thanks. I'm am known for doing the same. You're welcome.
Free Windows Admin Tool Kit Click here and download it now
May 20th, 2008 11:05pm

I need to further format this expression. in the :mms sections if the value is under 10 seconds this isn't returning a leading zero. ex: 12:6:6.. I want to show this as 12:06:06.. =int(sum(Fields!Sec_Online.Value)/3600) & ":" & int((sum(Fields!Sec_Online.Value) Mod 3600)/60) & ":" & (sum(Fields!Sec_Online.Value) Mod 3600) Mod 60
May 30th, 2008 4:48pm

I know this is an old thread but I wanted to through this out there. I have fought with this all day and found another solution that might be helpful for those that are searching the forum.... http://msdn.microsoft.com/en-us/library/system.timespan.fromseconds.aspx
Free Windows Admin Tool Kit Click here and download it now
November 5th, 2010 2:01pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics