Question

I am trying to set this col but I get an error:

FirstName + (CASE WHEN LEN(FirstName + LastName) > 0 THEN ' ' ELSE '') + LastName
Was it helpful?

Solution

You should close CASE with END and also, to my opinion, the following value will be better:

FirstName + (CASE WHEN LEN(FirstName) > 0 AND LEN(LastName) > 0 THEN ' ' ELSE '' END) + LastName

OTHER TIPS

FirstName + (CASE WHEN LEN(FirstName + LastName) > 0 THEN ' ' ELSE '' end) + LastName

missing the end

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top