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 |
egemen_ates
Yak Posting Veteran
76 Posts |
Posted - 2013-03-22 : 08:50:09
|
Hello Myfrinedi have two columnE_DATE E_TIME20130322 081104How can i convert datetime using two columnsresult is 2013-03-22 08:11:04.000thank you |
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2013-03-22 : 09:26:18
|
http://www.sqlservercurry.com/2011/09/sql-server-concatenate-date-and-time.html Too old to Rock'n'Roll too young to die. |
|
|
bandi
Master Smack Fu Yak Hacker
2242 Posts |
Posted - 2013-03-22 : 09:36:23
|
DECLARE @tabDate TABLE( E_DATE CHAR(8), E_TIME CHAR(6))INSERT INTO @tabDate VALUES('20130322', '081104')SELECT CAST ( E_DATE + ' ' + STUFF(STUFF(E_TIME, 3, 0, ':'), 6, 0, ':') AS DATETIME2) FROM @tabDate--Chandu |
|
|
|
|
|