T-SQL String Concatenation
I'm trying to join together five columns under one column heading when querying a table;
SELECT ([DD].[DADDR1] + [DD].[DADDR2] + [DD].[DADDR3] + [DD].[DADDR4] + [DD].[DADDR5]) AS 'DELIVERYADDRESS'
FROM DELDETS DD
WHERE DD.DRECNO=274001
However, whenever this query is run I get a null value returned - yet the query when run to return the five columns (i.e. SELECT DD.DADDR1, DD.DADDR2, DD.DADDR3 ...) does return data. It would seem that concatenating more than two columns in T-SQL is not possible - does anyone know if this is indeed the case?
|