SELECT A.COMMON_ID , A.SEQ_3C , B.CHECKLIST_SEQ , C2.LANGUAGE_CD , C2.DESCR , C2.DESCRLONG , D2.DESCR , E2.DESCR FROM PS_PERSON_CHECKLST A , PS_SCC_CKLSITM_TBL C , PS_ADM_FUNCTN_TBL D , PS_INSTITUTION_TBL E , PS_PERSON_CHK_ITEM B LEFT OUTER JOIN PS_EMAIL_ADDRESSES F ON B.RESPONSIBLE_ID = F.EMPLID AND F.PREF_EMAIL_FLAG = 'Y' , PS_SCC_CKLSITM_LNG C2 , PS_ADM_FUNCTN_LANG D2 , PS_INSTITUTION_LNG E2 WHERE A.COMMON_ID = B.COMMON_ID AND A.SEQ_3C = B.SEQ_3C AND B.CHKLST_ITEM_CD = C.CHKLST_ITEM_CD AND B.ITEM_STATUS NOT IN ('C','P','X','W') AND C.EFF_STATUS = 'A' AND C.EFFDT = ( SELECT MAX(C1.EFFDT) FROM PS_SCC_CKLSITM_TBL C1 WHERE C1.CHKLST_ITEM_CD = B.CHKLST_ITEM_CD AND C1.EFFDT <= %CurrentDateIn) AND A.ADMIN_FUNCTION = D.ADMIN_FUNCTION AND D.EFF_STATUS = 'A' AND D.EFFDT = ( SELECT MAX(D1.EFFDT) FROM PS_ADM_FUNCTN_TBL D1 WHERE D1.ADMIN_FUNCTION = A.ADMIN_FUNCTION AND D1.EFFDT <= %CurrentDateIn) AND A.INSTITUTION = E.INSTITUTION AND E.EFF_STATUS = 'A' AND E.EFFDT = ( SELECT MAX(E1.EFFDT) FROM PS_INSTITUTION_TBL E1 WHERE E1.INSTITUTION = A.INSTITUTION AND E1.EFFDT <= %CurrentDateIn) AND C.CHKLST_ITEM_CD = C2.CHKLST_ITEM_CD AND C.EFFDT = C2.EFFDT AND D.ADMIN_FUNCTION = D2.ADMIN_FUNCTION AND D.EFFDT = D2.EFFDT AND E.INSTITUTION = E2.INSTITUTION AND E.EFFDT = E2.EFFDT
|