i'm trying to pass case statement in my where clause but it seems i'm missing something or it's not possible in my scenario below is my code
explanation of the code "if the sysdate is Sunday i want to retrieve data for the past 3 days esle take yesterday data "
FROM lea_nf1.lea_agreement_dtl c--, lea_nf1.LEA_GUARANTOR_HIRER_DTL d
WHERE
case when to_char(sysdate,'Day') = 'Sunday' then
to_char(C.DISBURSALDATE , 'mm') = to_char(sysdate-1, 'mm')
and to_char(C.DISBURSALDATE , 'yyyy') = to_char(sysdate-1, 'yyyy')
and C.DISBURSALDATE between trunc(sysdate-3) and trunc(sysdate-1)
else
to_char(C.DISBURSALDATE , 'mm') = to_char(sysdate-1, 'mm')
and (to_char(C.DISBURSALDATE , 'yyyy') = to_char(sysdate-1, 'yyyy')
and C.DISBURSALDATE < sysdate end
ORDER BY C.DISBURSALDATE desc
below is the error
ORA-00905: missing keyword
appreciate your support.