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
 SQL Server Development (2000)
 Time Conversion

Author  Topic 

whitmoj
Yak Posting Veteran

68 Posts

Posted - 2008-11-05 : 07:55:17
I have a table with a oracle time 94602 but it shoul read 094602 the column is a decimal 12,0. I am looking at changing this to HH:MM:SS. Any help would be greatful.

Whitmoj
If you are in a hurry you will never get there

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-11-05 : 07:59:09
does 094602 represent 9:46:02?
Go to Top of Page

whitmoj
Yak Posting Veteran

68 Posts

Posted - 2008-11-05 : 08:00:16
yes

Whitmoj
If you are in a hurry you will never get there
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-11-05 : 08:11:40
SELECT STUFF(STUFF(RIGHT('0'+CAST(94602 as varchar(6)),6),3,0,':'),6,0,':')
Go to Top of Page

whitmoj
Yak Posting Veteran

68 Posts

Posted - 2008-11-05 : 08:22:06
Many Thanks and have a nice day

Whitmoj
If you are in a hurry you will never get there
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-11-05 : 11:12:31
[code]SELECT STUFF(STUFF(RIGHT('000000' + CAST(Col1 AS VARCHAR(6)), 6), 3, 0, ':'), 6, 0, ':')
FROM Table1[/code]
Just in case there are records as 17 which is 17 seconds over midnight


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

- Advertisement -