APP-PAY-6956 Element entry overlaps with another entry of the same type

This script will identify a date data problem with element entries:


SELECT   '*' e, pee.assignment_id, pee.effective_start_date,
         pee.effective_end_date, pee.element_entry_id
    FROM pay_element_entries_f pee
   WHERE pee.creator_type = 'SP'
     AND EXISTS (
            SELECT pee2.effective_start_date
              FROM pay_element_entries_f pee2
             WHERE pee2.assignment_id = pee.assignment_id
               AND pee2.creator_type = 'SP'
               AND pee2.element_entry_id != pee.element_entry_id
               AND pee2.element_link_id = pee.element_link_id)
     AND NOT EXISTS (
            SELECT ppp.change_date
              FROM per_pay_proposals ppp
             WHERE ppp.change_date = pee.effective_start_date
               AND pee.assignment_id = ppp.assignment_id)
UNION
SELECT   ' ' e, pee.assignment_id, pee.effective_start_date,
         pee.effective_end_date, pee.element_entry_id
    FROM pay_element_entries_f pee
   WHERE pee.creator_type = 'SP'
     AND EXISTS (
            SELECT pee2.effective_start_date
              FROM pay_element_entries_f pee2
             WHERE pee2.assignment_id = pee.assignment_id
               AND pee2.creator_type = 'SP'
               AND pee2.element_entry_id != pee.element_entry_id
               AND pee2.element_link_id = pee.element_link_id)
     AND EXISTS (
            SELECT ppp.change_date
              FROM per_pay_proposals ppp
             WHERE ppp.change_date = pee.effective_start_date
               AND pee.assignment_id = ppp.assignment_id)
ORDER BY assignment_id, effective_start_date


1 comment:

  1. Hello Dear,
    I observe that, it happens when you have the element has standard and link with all payroll.
    hope answer the question
    thanks

    ReplyDelete