I have a join query, I want Replace a NULL value with a string if is null. If it is not NULL, replace with a null string.
select distinct Code= R_Schedule.FoodId,Name= FoodName + ' = price ' +(CONVERT( varchar(50),R_Foods.FoodPrice) + ISNULL(str(R_Schedule.dayId ),' - public-')) from R_Foods join R_Schedule on R_Foods.FoodId=R_Schedule.FoodId where R_Schedule.DayId=6 or DayId is null
please this this Image : https://i.sstatic.net/Kv81f.png
Important section of my query is :
ISNULL(str(R_Schedule.dayId ),' - public -'))
This section if it is null return 'public' else if it is not null return column's id. I don't want return id if it is not null.
Case When Thenwould work