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 |
palaparu
Starting Member
20 Posts |
Posted - 2011-01-25 : 09:40:38
|
Hi Friends can any one tell me the syntax for appending the columnsI Have 2 columns named Col1 and Col2Col1 col2 Col3 (Col1 + Col2)123 456 123456 (not the addition of 123+456 = 579) |
|
nigelrivett
Master Smack Fu Yak Hacker
3385 Posts |
Posted - 2011-01-25 : 10:42:35
|
convert(varchar(3),col1)+convert(varchar(3),col2)or maybe col1*1000+col2orright(' '+convert(varchar(3),col1),3)+right(' ' + convert(varchar(3),col2),3)depends what you want to cater for the numbers being less than 3 digits and what datatype you want the result to be.==========================================Cursors are useful if you don't know sql.SSIS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
palaparu
Starting Member
20 Posts |
Posted - 2011-01-25 : 11:32:14
|
thank you so much dude |
 |
|
|
|
|