SQLTeam.com | Weblogs | Forums

If there is a value in the column then to say so

In this query I want to be able to have- for the column attached_document, if there is a null value, I want to have it output 'No attachment' else for any value there, it would be 'has attachment'.
select ev.actual_date, ev.event_name, ev.generic_description, ev.full_name as client_name,
ev.staff_desc as staff, ev.user_entered_desc as entered_by, ev.attached_document
from event_view ev where event_name in
('Treatment Plan', 'Treatment Plan Rev.2', 'Treatment Plan Review',
'Treatment Plan Review Rev.2') and is_service_event = '1'
order by event_name, actual_date, client_name

select ev.actual_date, ev.event_name, ev.generic_description, ev.full_name as client_name,
ev.staff_desc as staff, ev.user_entered_desc as entered_by
,CASE WHEN ev.attached_document IS NULL THEN 'No Attachment'
ELSE 'has attachment' END AS Attachment
from event_view ev where event_name in
('Treatment Plan', 'Treatment Plan Rev.2', 'Treatment Plan Review',
'Treatment Plan Review Rev.2') and is_service_event = '1'
order by event_name, actual_date, client_name

Thank you Robert. It's very strange - this produced no output. It must be the Null.