-1

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?

Sanju Menon
  • 747
  • 1
  • 10
  • 24

1 Answers1

0
CASE WHEN po_amend_received_date IS NULL THEN 'Pending'  
else  po_amend_received_date 
end as `po_amend_received_date`
Ankit Agrawal
  • 2,426
  • 1
  • 13
  • 27