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.
Author |
Topic |
giannilionetti
Starting Member
3 Posts |
Posted - 2013-01-17 : 05:41:55
|
I need to Convert a number without decimal in HH:mm:ss |
|
James K
Master Smack Fu Yak Hacker
3873 Posts |
Posted - 2013-01-17 : 05:52:58
|
What is content of the number? is it YYYYMMDDHHmmss or HHmmss or something else? Post some sample data? |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-01-17 : 05:53:58
|
just do like example below provided number represents secondsDECLARE @Number intSET @Number=234SELECT CONVERT(varchar(8),DATEADD(ss,@Number,0),108) ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2013-01-17 : 06:05:10
|
In 2012, you can also doselect format(getdate(),'hh:mm:ss')MadhivananFailing to plan is Planning to fail |
|
|
|
|
|