Solved

Expression for converting seconds to Hours and Minutes in SQL Reporting

Posted on 2008-10-06
3
882 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hi, I am very much excited today since I'm going to share something very exciting Tool used for Analytical Reporting and that's nothing but MICROSTRATEGY. Actually there are lot of other tools available in the market for Reporting Such as Co…
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

786 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