Would like to know how to write the following as part of the where clause:
I tried below and received error message
[Error] Execution (5: 57): ORA-00905: missing keyword
WHERE
If today is Monday then the where clause would be:
Application_Date is >= Last Friday --last Friday, Saturday, Sunday and today, Monday --
Otherwise the where clause would be
Application_Date = Yesterday only
I tried below and received error message
[Error] Execution (5: 57): ORA-00905: missing keyword
Code:
SELECT a.*
FROM admissions_application a
WHERE
CASE WHEN to_char(sysdate,'D') = '2' THEN --Monday
to_char(application_date,'yyyymmdd') >= to_char(sysdate - 3,'yyyymmdd')
ELSE
to_char(sysdate - 1) = to_char(application_date)
END
AND academic_period = '201140'
AND...