select distinct papf.EMPLOYEE_NUMBER "Employee Number", papf.title || ' ' ||papf.first_name || ' ' || papf.last_name "Full Name", ppt.USER_PERSON_TYPE "Employee Status", haou.NAME "Department", pps.ACTUAL_TERMINATION_DATE "Actual Terminatin Date", lvl.meaning "Reason for Leaving" from hr.per_all_people_f papf, hr.per_all_assignments_f paaf, per_assignment_status_types past, hr.hr_all_organization_units haou, hr.per_person_types ppt, hr.per_periods_of_service pps, apps.fnd_lookup_values_vl lvl where papf.PERSON_ID = paaf.PERSON_ID and paaf.ORGANIZATION_ID = haou.ORGANIZATION_ID and papf.PERSON_TYPE_ID = ppt.PERSON_TYPE_ID and papf.PERSON_ID = pps.PERSON_ID and papf.employee_number != 700054 and pps.LEAVING_REASON = lvl.LOOKUP_CODE and lvl.LOOKUP_TYPE = 'LEAV_REAS' --and pps.actual_termination_date = sysdate and trunc(sysdate) between papf.EFFECTIVE_START_DATE and papf.EFFECTIVE_END_DATE and ppt.USER_PERSON_TYPE = 'Ex-employee