--query to find emp number from their per_analysis_criteria
SELECT PAPF.EMPLOYEE_NUMBER,
PPA.PERSON_ID,PPA.ID_FLEX_NUM,
SEGMENT1, SEGMENT2, SEGMENT3,
SEGMENT8,SEGMENT11
-- PERSON_ID, TRUNC(LAST_UPDATE_DATE)
FROM PER_PERSON_ANALYSES PPA,
PER_ANALYSIS_CRITERIA PAC,
per_all_people_f papf,
per_all_assignments_f paaf
WHERE
PPA.ANALYSIS_CRITERIA_ID = PAC.ANALYSIS_CRITERIA_ID
AND PAPF.PERSON_ID = PPA.PERSON_ID
and paaf.payroll_id = 109
and papf.person_id = paaf.person_id
and date_from >= to_date('01-nov-2014')-- and last_day(to_date('01-nov-2014'))
--AND TRUNC(PPA.LAST_UPDATE_DATE) = TRUNC(TO_DATE('30-NOV-2014'))
--AND PPA.LAST_UPDATED_BY = 1687
AND TRUNC(TO_DATE('30-NOV-2014')) BETWEEN PAPF.EFFECTIVE_START_DATE AND PAPF.EFFECTIVE_END_DATE
AND TRUNC(TO_DATE('30-NOV-2014')) BETWEEN PAaF.EFFECTIVE_START_DATE AND PAaF.EFFECTIVE_END_DATE
and segment8 = 'إجازة سنوية'--not in ('إجازة وضع','Annual Leave (Info.)','إجازة عارضة','إجازة مرضية',''
SELECT PAPF.EMPLOYEE_NUMBER,
PPA.PERSON_ID,PPA.ID_FLEX_NUM,
SEGMENT1, SEGMENT2, SEGMENT3,
SEGMENT8,SEGMENT11
-- PERSON_ID, TRUNC(LAST_UPDATE_DATE)
FROM PER_PERSON_ANALYSES PPA,
PER_ANALYSIS_CRITERIA PAC,
per_all_people_f papf,
per_all_assignments_f paaf
WHERE
PPA.ANALYSIS_CRITERIA_ID = PAC.ANALYSIS_CRITERIA_ID
AND PAPF.PERSON_ID = PPA.PERSON_ID
and paaf.payroll_id = 109
and papf.person_id = paaf.person_id
and date_from >= to_date('01-nov-2014')-- and last_day(to_date('01-nov-2014'))
--AND TRUNC(PPA.LAST_UPDATE_DATE) = TRUNC(TO_DATE('30-NOV-2014'))
--AND PPA.LAST_UPDATED_BY = 1687
AND TRUNC(TO_DATE('30-NOV-2014')) BETWEEN PAPF.EFFECTIVE_START_DATE AND PAPF.EFFECTIVE_END_DATE
AND TRUNC(TO_DATE('30-NOV-2014')) BETWEEN PAaF.EFFECTIVE_START_DATE AND PAaF.EFFECTIVE_END_DATE
and segment8 = 'إجازة سنوية'--not in ('إجازة وضع','Annual Leave (Info.)','إجازة عارضة','إجازة مرضية',''
No comments:
Post a Comment