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)
 Converting Time Values

Author  Topic 

ninel
Posting Yak Master

141 Posts

Posted - 2008-02-16 : 11:25:27
I have a value in seconds ...120
Is there any way to convert it to a value like this... 00:02:00?

[00] is the hour :[02]is the minute and :[00]is the seconds.

Thanks,
Ninel

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2008-02-16 : 11:31:19
declare @secs int

select @secs = 120

select convert(varchar(8), dateadd(second, @secs, 0), 108)


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

ninel
Posting Yak Master

141 Posts

Posted - 2008-02-16 : 11:35:26
Thank you so much.
Go to Top of Page
   

- Advertisement -