Solved

Expression for converting seconds to Hours and Minutes in SQL Reporting

Posted on 2008-10-06
3
872 Views
Last Modified: 2010-04-21
Hi all,

Running SQL 2005 Reporting Services.  I have a field in my report that shows total seconds.  I would like to show that value as hours and minutes (ie 3:05 for 3 hours 5 minutes).  Right now I have this expression:
=(Fields!TIMEINSECONDS.Value)\60) \60 & ":" & (Fields!TIMEINSECONDS.Value)\60) \60) \60

But this shows as 3:5

Is there a better expression to accurately get what I want?
0
Comment
Question by:ckangas7
  • 2
3 Comments
 
LVL 9

Expert Comment

by:srivatsavaye
ID: 22674149
Hi,

I think you have to write a simple VB.NET function to return the string.
0
 
LVL 9

Accepted Solution

by:
srivatsavaye earned 125 total points
ID: 22674332
here is the expression that returns what you want

=Fields!secs.Value\60 \60 & ":" & iif((Fields!secs.Value mod 3600)\60 > 9, (Fields!secs.Value mod 3600)\60, "0" & (Fields!secs.Value mod 3600)\60)
0
 

Author Closing Comment

by:ckangas7
ID: 31503607
Awesome.  Thanks.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Hello, In my precious Article  (http://www.experts-exchange.com/Database/Reporting/A_15280-Create-Project-in-Microstrategy-Part-I.html)we saw the Configuration part for Microstrategy which included Metadata Creation and DataSource Preparation as …
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now