Case statement for a date field with Mysql db

Sanju Menon

Iam trying to do a CASE statement. The requirement is if Date field is NULL then show it as 'Pending' or else show the date from the db.

I have tried the below case statement but there is some problem.

CASE po_amend_received_date IS NULL WHEN 1 THEN 'Pending'  
ELSE po_amend_received_date END AS `po_amend_received_date`

Am i making any mistake here?

Ankit Agrawal
CASE WHEN po_amend_received_date IS NULL THEN 'Pending'  
else  po_amend_received_date 
end as `po_amend_received_date`

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related