Solved

Expression for converting seconds to Hours and Minutes in SQL Reporting

Posted on 2008-10-06
3
902 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

1. Set up your parameter at the report level as usual, check the box Multi-value, and set the Data Type to String 2. Set the Stored Procedure Parameter to varchar(max)  --<---- This part here is the key to it's success Example:    @cst_key var…
Problem Statement In an SAP BI BO Integration project when a BO universe is built on a BEx query, there can be an issue of unit & formatted value objects not getting generated in a BO universe for some key figures. This results in an issue whereb…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

688 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