I have this code and am getting an error, can someone help me understandy why the error exists with both case statements but not individually?
CASE WHEN ([Planned_Event_Status] = 'ES' AND [Activity Stat Cd] = 'A') THEN 'Y'
CASE WHEN ((NOT ([Planned_Event_Status] LIKE 'ES')) AND [Activity Stat Cd] = 'O') THEN 'Y'
ELSE 'N' END AS [(GPSy - PLC Error)]
Msg 156, Level 15, State 1, Line 3
Incorrect syntax near the keyword 'CASE'.