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 2000 Forums
 Transact-SQL (2000)
 getting hh:mm:ss from seconds in (oracle) if poss

Author  Topic 

g_r_a_robinson
Starting Member

45 Posts

Posted - 2004-09-13 : 22:40:48
I have so many seconds and i need to be able to have returned from this a hours:minutes:seconds returned.

IE

100 seconds

01:40:00

rockmoose
SQL Natt Alfen

3279 Posts

Posted - 2004-09-14 : 03:04:35
in sql server ( for max value of 359999 seconds )
declare @s int
set @s = 100
select replace((str(@s/3600,2) + ':' + str((@s%3600)/60,2) + ':' + str(@s%60,2)),' ','0')

rockmoose
/* Chaos is the nature of things...Order is a lesser state of chaos */
Go to Top of Page
   

- Advertisement -