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 |
learning_grsql
Posting Yak Master
230 Posts |
Posted - 2013-05-14 : 03:54:51
|
I have a time column with text data type similar to below :190119021903190319031904190419051906....21002101210221022103 And I want now it to change similar to below. Basically, when the time is 1901, the output should be 1730, when 1902 it is 1731 and so on...173017311732173217321733173317341735........19291930193119311932 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-05-14 : 04:15:03
|
[code]SELECT CONVERT(varchar(5),DATEADD(ss,-91,STUFF([time],3,0,':')),108)FROM TableName[/code]------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2013-05-17 : 07:09:22
|
select col,cast(col as int) -171 from your_tableMadhivananFailing to plan is Planning to fail |
|
|
|
|
|