How to print text in select query instead of NULL value in DATE field in postgresql?
You need to cast it to string first. Check the below query;

select coalesce(to_char(enroll, 'YYYY-MM-DD'),'Error') as formatted from test;