To know Future
Element Entry Exists
Query to Know How many future Element Exists after a
Particular Date
SELECT
PETF.ELEMENT_NAME, PEEF.EFFECTIVE_START_DATE, PEEF.EFFECTIVE_END_DATE
FROM PER_ALL_ASSIGNMENTS_F PAAF,
PER_ALL_PEOPLE_F PAPF,
PAY_ELEMENT_TYPES_F PETF,
PAY_ELEMENT_LINKS_F PELF,
PAY_ELEMENT_ENTRIES_F PEEF
WHERE
PAPF.PERSON_ID = PAAF.PERSON_ID
AND TRUNC (SYSDATE) BETWEEN
PAPF.EFFECTIVE_START_DATE
AND
PAPF.EFFECTIVE_END_DATE
AND TRUNC (SYSDATE) BETWEEN
PAAF.EFFECTIVE_START_DATE
AND
PAAF.EFFECTIVE_END_DATE
AND TRUNC (SYSDATE) BETWEEN
PETF.EFFECTIVE_START_DATE
AND
PETF.EFFECTIVE_END_DATE
AND TRUNC (SYSDATE) BETWEEN
PELF.EFFECTIVE_START_DATE
AND
PELF.EFFECTIVE_END_DATE
AND (
PEEF.EFFECTIVE_START_DATE >
TO_DATE ('16-NOV-2014',
'DD-MON-RRRR') /* Enter Date After which
u Want to Know How many Future Element Entry Exists */
OR NVL (PEEF.EFFECTIVE_END_DATE,
TO_DATE ('31-DEC-4712',
'DD-MON-RRRR')) >
TO_DATE ('16-NOV-2014'))
AND PETF.ELEMENT_TYPE_ID =
PELF.ELEMENT_TYPE_ID
AND PELF.ELEMENT_LINK_ID =
PEEF.ELEMENT_LINK_ID
AND PEEF.ASSIGNMENT_ID =
PAAF.ASSIGNMENT_ID
AND PAPF.EMPLOYEE_NUMBER = '1501204';
No comments:
Post a Comment