Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert Seconds to HH:MM in Reporting Services

Status
Not open for further replies.

Jdbenike

MIS
Sep 11, 2008
74
US
Field
=Fields!TOTALTIME.Value
In reporting services comes back as total seconds for a day.
If I divide it like this.
=Fields!TOTALTIME.Value / 60 / 60
I would get results like 7.50, and 7.88.
How do I convert the field to show hour and minutes like on a clock? So everytime it hits 60 minutes its the next hour.
So 7.50 I think would be like 7 hour and 30 minutes
 
You are missing a / 24

There are 86400 seconds in a day. times are based on Date/Time rather than just time where 1 day = 1 so you need to divide your value by 86400 and format as hh:mm

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
An extra /24 just gives me different values.

With this formula in sql
Convert(VarChar(2), sum(timeinseconds) / 3600) + ':' + Convert(VarChar(2), sum(timeinseconds) / 60 % 60) as TotalTime,

I can get it to come back correctly, minus one place behind the value. So it would 21600 seconds would come back as 6:0 instaed of 6:00.

Anyways, I need a way to put this into reporting services. So that in reporting services I can sum these values.
 
An extra /24 just gives me different values.

With this formula in sql
Convert(VarChar(2), sum(timeinseconds) / 3600) + ':' + Convert(VarChar(2), sum(timeinseconds) / 60 % 60) as TotalTime,

I can get it to come back correctly, minus one place behind the value. So it would 21600 seconds would come back as 6:0 instaed of 6:00.

Anyways, I need a way to put this into reporting services. So that in reporting services I can sum these values.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top