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 |
inbs
Aged Yak Warrior
860 Posts |
Posted - 2014-12-04 : 04:53:20
|
i have column that show the time but in format inthow i show it in this formatTimeCol16007300TimeCol16:0007:300 |
|
sunder.bugatha
Yak Posting Veteran
66 Posts |
Posted - 2014-12-04 : 06:49:38
|
SELECT (CASE WHEN LEN(TIMECOL)=4 THEN SUBSTRING(TIMECOL,1,2)+':'+SUBSTRING(TIMECOL,3,2)WHEN LEN(TIMECOL)=3 THEN '0'+SUBSTRING(TIMECOL,1,1)+':'+SUBSTRING(TIMECOL,2,2)ELSE TIMECOLEND) FROM test1Hema Sunder |
|
|
sunder.bugatha
Yak Posting Veteran
66 Posts |
Posted - 2014-12-04 : 06:55:20
|
replace Timecol with CONVERT(VARCHAR(10),TIMECOL) if it is an integerHema Sunder |
|
|
|
|
|