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 |
|
hariharans87
Starting Member
6 Posts |
Posted - 2011-07-25 : 04:09:07
|
I am using the code:SELECT CONVERT(varchar(10),dtmTimeFrom,100) AS TimeFrom FROM tblPosts Result: 8:48AMI want the result like: 8:48 AMSpace before AM and PM.Thanks,Hari. |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2011-07-25 : 04:35:05
|
can't you format the TIME in your front end application ? KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
eralper
Yak Posting Veteran
66 Posts |
Posted - 2011-07-25 : 04:45:43
|
You can add a space using replace REPLACE(REPLACE(@s, 'AM', ' AM'), 'PM', ' PM') -------------Eralperhttp://www.kodyaz.com |
 |
|
|
lionofdezert
Aged Yak Warrior
885 Posts |
Posted - 2011-07-25 : 04:50:28
|
| SELECT STUFF(CONVERT(varchar(100),GETDATE(),100),18,0,' ')--------------------------http://connectsql.com/ |
 |
|
|
hariharans87
Starting Member
6 Posts |
Posted - 2011-07-25 : 07:59:59
|
| Thanks for your replies. |
 |
|
|
|
|
|
|
|