Iam trying to write a CASE statement for the below Table structure:
========================================
tender_cust_shortcode | open_auth_date
========================================
HAL Hydera | 24-01-2016
DRDL | NULL
HAL ARDC | 10-02-2016
DLRL | NULL
ISAC | NULL
========================================
My CASE statement is as follows:
CASE WHEN (tender_cust_shortcode = 'HAL Hydera' OR 'HAL ARDC') THEN 'N/A'
WHEN (tender_cust_shortcode != 'HAL Hydera' OR 'HAL ARDC') AND open_auth_date IS NULL
THEN 'Pending'
ELSE 'Completed' END AS `Open Auth Status`
The criteria is
1) if (tender_cust_shortcode = 'HAL Hydera' OR 'HAL ARDC') Then it should result as 'N/A'
2) if (tender_cust_shortcode != 'HAL Hydera' OR 'HAL ARDC') AND open_auth_date IS NULL then it should result as 'Pending'
3) Else 'Completed'.
Iam not getting the desired output. May be AND or OR condition problem. Please can anyone help me on this?