fix person_course sql to use proper logs and pcday when using latest