Reputation: 261
I'm using SQL Server 2008 R2 and have two nvarchar fields that I want to concatenate using RTRIM function. However, when I do, all I get are NULL values.
Below is the sample function I'm using:
RTRIM(gis.dbo.tbl.Name1) + ' ' + RTRIM(gis.dbo.tbl.Name2)
Thanks in advance!
Upvotes: 0
Views: 659
Reputation: 10014
Have you checked that your fields have values? If either of them are null, your code won't work. You could try like this instead to catch the null values:
RTRIM(ISNULL(gis.dbo.tbl.Name1, '')) + ' ' + RTRIM(ISNULL(gis.dbo.tbl.Name2, ''))
Upvotes: 1