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 |
|
chfunglukas
Starting Member
1 Post |
Posted - 2010-09-17 : 03:21:29
|
| This is a sql datatype problemHelloI am a junior programmer and new member of this forumI want to ask a questionI have these two columns in sql 2000 servertrx_date char(8)trx_time char(6)And now, I imported this database to sql 2008and want to copy those two columns' record to a new column calltrx_datetime (datetime)Please guide me , thanks |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-09-17 : 03:23:02
|
example data? No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
vaibhavktiwari83
Aged Yak Warrior
843 Posts |
Posted - 2010-09-17 : 03:30:51
|
quote: Originally posted by chfunglukas This is a sql datatype problemHelloI am a junior programmer and new member of this forumI want to ask a questionI have these two columns in sql 2000 servertrx_date char(8)trx_time char(6)And now, I imported this database to sql 2008and want to copy those two columns' record to a new column calltrx_datetime (datetime)Please guide me , thanks
Try this - SELECT trx_date + ' ' + trx_time FROM tableI think it will work.Vaibhav TTo walk FAST walk ALONE To walk FAR walk TOGETHER |
 |
|
|
Sachin.Nand
2937 Posts |
Posted - 2010-09-17 : 04:15:14
|
What happens if you execute the below query in SQL 2000select convert(datetime,trx_date + '' + trx_time )from yourtable Limitations live only in our minds. But if we use our imaginations, our possibilities become limitless. PBUH |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2010-09-17 : 06:25:20
|
What format for date are you using when storing data as text? N 56°04'39.26"E 12°55'05.63" |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-09-17 : 07:34:19
|
quote: Originally posted by Peso What format for date are you using when storing data as text? N 56°04'39.26"E 12°55'05.63"
That's why I asked for example data  No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
|
|
|