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 |
Clages1
Yak Posting Veteran
69 Posts |
Posted - 2008-07-30 : 10:30:14
|
Hi I have a table with a Smalldatetime if i do "substring(Cast (mob1_emissao as Char(19)), 13,5) " in this Column instead of 14:43:00 i get 2:43I would like to get 14:43TksClages2008-01-25 14:43:00 2:432008-01-25 15:25:00 3:252008-01-25 18:36:00 6:362008-01-25 11:20:00 11:202008-01-25 15:15:00 3:152008-01-25 18:44:00 6:442008-01-25 19:01:00 7:012008-01-25 15:35:00 3:352008-01-25 18:56:00 6:56 |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
|
VGuyz
Posting Yak Master
121 Posts |
Posted - 2008-07-30 : 10:41:08
|
SELECT CONVERT(VARCHAR(20), GETDATE(), 100) |
 |
|
Clages1
Yak Posting Veteran
69 Posts |
Posted - 2008-07-30 : 17:11:24
|
CONVERT(VARCHAR(20), mob1_emissao, 100)Doenst work because i get 2:43PM and I Need 14:43In the Grid I can not get AM/PM , only de timeOk , Now i am adding 12 to the timebut i am looking for a better solutionTksCLages Original Column Converted Column 2008-01-25 11:20:00 Jan 25 2008 11:20AM2008-01-25 14:43:00 Jan 25 2008 2:43PM |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2008-07-30 : 17:33:29
|
[code]select DT = convert(varchar(19),getdate(),121)Results:DT------------------- 2008-07-30 17:32:44(1 row(s) affected)[/code]CODO ERGO SUM |
 |
|
Clages1
Yak Posting Veteran
69 Posts |
Posted - 2008-07-31 : 18:59:58
|
tks,Now working fineClages1 |
 |
|
|
|
|
|
|