Im trying to filter results by a specific date but when I use the below code I only get results where CloseDate matches current date. It doesnt include the results from ResolvedDate when CloseDate is Null. I tried with :
(CASE WHEN (Closedate IS Null) then ResolvedDate, ELSE CloseDate END) AS FinalDate
but then it states:
"column FinalDate does not exist"
Any other way I can do this?
Here is the code thus far. Appreciate your help.
SELECT
id,
(CASE WHEN (Closedate IS Null) then ResolvedDate, ELSE CloseDate END),
FROM cases
WHERE (EXTRACT (month FROM Closedate) = EXTRACT(month FROM current_date))
AND ( EXTRACT(day from Closedate) = EXTRACT(day FROM current_date))