When the date is NULL I want to display 'N/A', but if the date is not null I want to display the date in the dB. This is what I currently have and I get a DataType Mismatch in the THEN/ELSE expressions. I am assuming it is because I am trying to display a character in a date field.
SELECT
CASE WHEN created_at IS NULL
THEN 'N/A'
ELSE created_at
END AS created_at
FROM example.example_id
Is this possible?
Instead of CASE you can use COALESCE, too, but you still need to convert the date to a string first: