Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Analysis Server and Reporting Services (2005)
 Conversion of seconds to hh:mm:ss

Author  Topic 

whitmoj
Yak Posting Veteran

68 Posts

Posted - 2010-12-09 : 03:01:07
I wonder if any one can help me with this one. I Have a data feed coming from SQL showing seconds ie 12000. I know in excel I would divide this figure by 86400 and format it as a time this would give me 03:20:00. But my question is how do I format the data in SSRS. I must mention that 12000 is a sum value as it is a months worth of data.

Many thanks for your help

Whitmoj
If I have inspired one person today then my job is done.

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2010-12-09 : 03:27:46
SELECT CONVERT(CHAR(8), DATEADD(SECOND, 12000, 0), 8)


N 56°04'39.26"
E 12°55'05.63"
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-12-09 : 04:13:28
http://social.msdn.microsoft.com/forums/en-US/sqlreportingservices/thread/063f13c0-061c-4c31-92c2-46b31068285b

http://social.msdn.microsoft.com/Forums/en/sqlreportingservices/thread/bdd66a8f-6ad5-4e89-95d7-c023fdfb58bc


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

whitmoj
Yak Posting Veteran

68 Posts

Posted - 2010-12-09 : 04:20:05
This does not work in SSRS. Ideally I need it to work on the report as my customers can choose any date range and the report sum's it up

Whitmoj
If I have inspired one person today then my job is done.
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-12-09 : 04:26:07
Did you read the posted links?


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

whitmoj
Yak Posting Veteran

68 Posts

Posted - 2010-12-09 : 04:37:35
The second link works great if it's less than 24 hours I use that in my daily view thanks. The first link is a bit strange as it does not seem to want to do any thing the first AS shows as a syntax error and when I remove that and the trailing name the comma becomes a syntax error. I will plod through and see if I can get it to work.

Whitmoj
If I have inspired one person today then my job is done.
Go to Top of Page
   

- Advertisement -