Reputation: 139
For a directory, I want the words "visit website" to appear only if the member has entered a website. I do not want to retrieve the actual web site url.
Replace and Coalesce seem to work only if the value is null.
This is certainly not working
SELECT replace (eweb,'website','website') as value
from Web_FacStaffdir
where eweb is not null
Upvotes: 1
Views: 4119
Reputation: 4686
Something like:
SELECT CASE WHEN LEN(eweb) > 0 THEN 'website' ELSE '' END as value
from Web_FacStaffdir
where eweb is not null
Upvotes: 3