I was able to combine three columns with following sql statement but the problem that i am having is if one of the column has a null value the concatenation does not work and the sql statement does not return any thing. I am not sure why this is happening. Is there a way to accomplish this even though the fields contain null value.
Sql statement:
- Select CAST(Customer.Contactid as nvarchar(10)) +'-'+ Customer.Firstname +','+ Customer.LastName as Name from Customer where customerid = 1547854
Data types:
Contactid -- int
FirstName -- nvarchar
LastName -- nvarchar
Note: The above sql statement works perfect if non of the fields have null value.
Thank you in advance