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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 CODING HELP HELP

Author  Topic 

sr456
Starting Member

1 Post

Posted - 2014-02-01 : 18:00:40
HELPP

I'm trying to join two columns together to form a new column

my code is basically in the form of can't post the actual since it would be cheating--school assignment

SELECT Column1Name,Column2Name, Column3Name,Column4Name,
Column1Name+Column2Name AS NewColumn1
Column3Name+Column4Name AS NewColumn1
FROM OriginalTable

What am I doing wrong please help?

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2014-02-01 : 18:14:34
Check the datatypes of the two columns.
CONCAT (available from SQL Server 2012) is the way to "add" strings nowadays.



Microsoft SQL Server MVP, MCT, MCSE, MCSA, MCP, MCITP, MCTS, MCDBA
Go to Top of Page
   

- Advertisement -