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 |
|
Rheinhardt
Yak Posting Veteran
66 Posts |
Posted - 2009-04-06 : 08:49:35
|
| Hi,I am trying to join data from two columns into 1 column:Cola Colb100 Peter...to read "100-Peter"Please assist as SQL 2005 does not recognize the function CONCAT.Thanks |
|
|
asgast
Posting Yak Master
149 Posts |
Posted - 2009-04-06 : 08:51:26
|
| SELECT cola + colb FROM ....all the columns must have varchar type |
 |
|
|
ayamas
Aged Yak Warrior
552 Posts |
Posted - 2009-04-06 : 08:52:14
|
| Select Cola + '-' + Colb if Cola is varchar else Convert(Cola,varchar(20)) + '-' + Colb |
 |
|
|
Rheinhardt
Yak Posting Veteran
66 Posts |
Posted - 2009-04-06 : 09:12:18
|
| Thanks |
 |
|
|
|
|
|