I am having some syntax error in my case statement where I am checking below condition:
((RAP10B.CLMSRC = \'2\', RAP01.EFFDT - 3 years <= RAP10.LOSSDT < RA
It's generally much better to use AND
/OR
constructions in the WHERE
clause instead of case
expressions:
WHERE (RAP10B.CLMSRC = '2'
AND rap10.lossdt_t BETWEEN Add_months(rap01.teffdt_t, - 36) AND rap01.teffdt_t)
OR (RAP10B.CLMSRC <> '2'
AND rap10.lossdt_t BETWEEN Add_months(rap01.teffdt_t, - 36) AND (rap01.teffdt_t - 60))