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
 Transact-SQL (2005)
 Convert Time to include 2 digits

Author  Topic 

lols
Posting Yak Master

174 Posts

Posted - 2008-03-29 : 06:54:49
Hi,

I want to convert time 2:8:6 to 02:08:06 in the easiest possible way. How to do it without using Left() or Right()

thanks.

nr
SQLTeam MVY

12543 Posts

Posted - 2008-03-29 : 09:32:54
select convert(varchar(8),convert(datetime,'2:8:6'),108)


==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

lols
Posting Yak Master

174 Posts

Posted - 2008-03-30 : 23:19:39
thanks a ton
Go to Top of Page
   

- Advertisement -