$ 0 0 Hi, AND RP.REGIS_DATETM BETWEEN (CURRENT_DATE -7) and CURRENT_DATEon a.MATCHD_CNSMR_PRSNA_ID = b.MATCHD_CNSMR_PRSNA_ID This ON is misplaced.
Hi,
AND RP.REGIS_DATETM BETWEEN (CURRENT_DATE -7) and CURRENT_DATE
on a.MATCHD_CNSMR_PRSNA_ID = b.MATCHD_CNSMR_PRSNA_ID
This ON is misplaced.