select PER.PERSON_NUMBER,
PPN.FULL_NAME,
TO_CHAR(ACC.PROCD_DATE,'DD-MON-YYYY','NLS_DATE_LANGUAGE = AMERICAN') PROCD_DATE,
(select NAME
from ANC_ABSENCE_PLANS_VL
WHERE ABSENCE_PLAN_ID = ACC.PL_ID) PLAN_NAME,
ACC.VALUE BALANCE
from ANC_PER_ACRL_ENTRY_DTLS ACC,
PER_ALL_PEOPLE_F PER,
PER_PERSON_NAMES_F PPN
WHERE ACC.PERSON_ID = PER.PERSON_ID
AND PER.PERSON_ID = PPN.PERSON_ID
AND TRUNC(SYSDATE) BETWEEN PER.EFFECTIVE_START_DATE AND PER.EFFECTIVE_END_DATE
AND TRUNC(SYSDATE) BETWEEN PPN.EFFECTIVE_START_DATE AND PPN.EFFECTIVE_END_DATE
AND PPN.NAME_TYPE = 'GLOBAL'
AND ACC.TYPE = 'INIT'
ORDER BY PER.PERSON_NUMBER
PPN.FULL_NAME,
TO_CHAR(ACC.PROCD_DATE,'DD-MON-YYYY','NLS_DATE_LANGUAGE = AMERICAN') PROCD_DATE,
(select NAME
from ANC_ABSENCE_PLANS_VL
WHERE ABSENCE_PLAN_ID = ACC.PL_ID) PLAN_NAME,
ACC.VALUE BALANCE
from ANC_PER_ACRL_ENTRY_DTLS ACC,
PER_ALL_PEOPLE_F PER,
PER_PERSON_NAMES_F PPN
WHERE ACC.PERSON_ID = PER.PERSON_ID
AND PER.PERSON_ID = PPN.PERSON_ID
AND TRUNC(SYSDATE) BETWEEN PER.EFFECTIVE_START_DATE AND PER.EFFECTIVE_END_DATE
AND TRUNC(SYSDATE) BETWEEN PPN.EFFECTIVE_START_DATE AND PPN.EFFECTIVE_END_DATE
AND PPN.NAME_TYPE = 'GLOBAL'
AND ACC.TYPE = 'INIT'
ORDER BY PER.PERSON_NUMBER
No comments:
Post a Comment