I have this string in SQL query :
[KeyCode] = Sub_Level_Key1 + '-' + isnull(Sub_Level_Key2, '') + '-' + isnull(Sub_Level_Key3, '')
returns something like: 01-02-03
my problem is if key2 or/and key3 are null it would be like: 01--
I need a way that if key2 and key3 are null that I do not show the dashes.
so It would be : 01
or : 01-03
or : 01-06-03
key2 wont be null be key3 is not null.