Hi Everyone,
I have the following in a view that I created in SQL 2005:
RTRIM(County_Code_1 +', '
+ County_Code_2 +', '
+ County_Code_3+', '
+ County_Code_4 +', '
+ County_Code_5) As County,
While it serves the purpose of joining all of the fields into one single string, it does not suppress the commas if the fields are null and the output looks sort of like Hunterdon, Atlantic,,,. Any suggestions, please? I searched the forum and found many tips for concatenating, however, there was nothing to suppress the commas if the field is null. Thank you.
I have the following in a view that I created in SQL 2005:
RTRIM(County_Code_1 +', '
+ County_Code_2 +', '
+ County_Code_3+', '
+ County_Code_4 +', '
+ County_Code_5) As County,
While it serves the purpose of joining all of the fields into one single string, it does not suppress the commas if the fields are null and the output looks sort of like Hunterdon, Atlantic,,,. Any suggestions, please? I searched the forum and found many tips for concatenating, however, there was nothing to suppress the commas if the field is null. Thank you.