SELECT C.OPRCLASS , A.SCC_TM_LIST_ID , A.SCC_TM_LABEL , A.SCC_TM_PARENT_TMPL , F.SCC_TM_DUE_DATE , D.SCC_TM_KEY_VALUE , A.SCC_TM_LIST_STATUS , PX.XLATLONGNAME , C.EMPLID , C.NAME_DISPLAY FROM PS_SCC_TM_PTAILIST A , PS_SCC_TM_PTAICNTX B , PS_SCC_TM_PTAICNTX D , PS_SCC_TM_PTAIITEM F , PS_PEOPLE_SRCH C , PSXLATITEM PX WHERE A.SCC_TM_IS_TMPL = 'N' AND A.SCC_TM_LIST_STATUS = 'IP' AND A.SCC_TM_ACTIVE_FLAG = 'Y' AND A.SCC_TM_LIST_ID = B.SCC_TM_LIST_ID AND B.FIELDNAME = 'EMPLID' AND B.SCC_TM_KEY_VALUE = C.EMPLID AND A.SCC_TM_LIST_ID = D.SCC_TM_LIST_ID AND D.FIELDNAME = 'INSTITUTION' AND A.SCC_TM_LIST_ID = F.SCC_TM_LIST_ID AND F.SCC_TM_PTAI_SEQ = ( SELECT MAX( G.SCC_TM_PTAI_SEQ) FROM PS_SCC_TM_PTAIITEM G WHERE F.SCC_TM_LIST_ID = G.SCC_TM_LIST_ID) AND PX.FIELDNAME='SCC_TM_LIST_STATUS' AND PX.FIELDVALUE=A.SCC_TM_LIST_STATUS AND %EffdtCheck( PSXLATITEM EF1, PX, %currentdatein)
|