SELECT A.HRS_PERSON_ID , B.NAME , C.OPRID FROM PS_HRS_EE_REFERRAL A , PS_HRS_APP_NAME_I B , PS_HRS_APP_SEC_VW C , PS_HRS_APPLICANT_I F WHERE A.HRS_PERSON_ID = F.HRS_PERSON_ID AND F.HRS_PERSON_ID = C.HRS_PERSON_ID AND F.HRS_PERSON_ID = B.HRS_PERSON_ID AND EXISTS ( SELECT 'X' FROM PS_HRS_EE_REF_ELIG C1 , PS_HRS_EE_REF_ELIG D WHERE C1.HRS_PERSON_ID = A.HRS_PERSON_ID AND C1.HRS_PERSON_ID = D.HRS_PERSON_ID AND C1.EMPLID <> D.EMPLID AND C1.ELIGIBILITY_STATUS = 'E' AND D.ELIGIBILITY_STATUS = 'E' AND C1.PROCESSED = 'N' AND D.PROCESSED = 'N') AND EXISTS ( SELECT 'X' FROM PS_HRS_EE_REF_AWD E WHERE E.HRS_PERSON_ID = A.HRS_PERSON_ID AND E.EMPLID = A.EMPLID AND E.PAYMENT_STAT_ER IN ('AP', 'NA') AND E.PAYMENT_STAT_ER NOT IN ('PD', 'TP'))
|