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 |
|
TMDOSS
Starting Member
33 Posts |
Posted - 2008-12-16 : 15:37:49
|
| I need to get only the time from the database.So I usedselect CONVERT(CHAR(8),getdate(),8) just to get the time.but it always returing times like 13:00 ,14.00 ect. is there any any I can get 1.00 PM ,2.00 PM ect...Any help greatly appreciated. |
|
|
hanbingl
Aged Yak Warrior
652 Posts |
Posted - 2008-12-16 : 15:53:35
|
| [code]select right(convert(varchar(25),getdate(),0),6)[/code] |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
Nageswar9
Aged Yak Warrior
600 Posts |
Posted - 2008-12-16 : 23:16:11
|
| Try this also , Put 100 in place of 0 select right(convert(varchar(25),getdate(),100),7)I Struggle For Excellence |
 |
|
|
TMDOSS
Starting Member
33 Posts |
Posted - 2008-12-17 : 09:08:35
|
| thank you. You guy's Rock |
 |
|
|
Nageswar9
Aged Yak Warrior
600 Posts |
Posted - 2008-12-17 : 23:21:46
|
| WelcomeI Struggle For Excellence |
 |
|
|
|
|
|