SELECT
persondeath.pcucodeperson,
persondeath.pid,
persondeath.deaddate,
ncd_person_ncd_screen.screen_date
FROM
persondeath
INNER JOIN ncd_person_ncd_screen ON ncd_person_ncd_screen .pcucode = persondeath.pcucodeperson AND ncd_person_ncd_screen.pid = persondeath.pid
WHERE
persondeath.deaddate <= ncd_person_ncd_screen.screen_date

and ncd_person_ncd_screen.screen_date BETWEEN '20151001' and '20160930'
