SELECT DISTINCT B.LM_MANAGER_ID , D.LM_NAME_DISPLAY , C.LM_CS_LONG_NM , B.LM_DUE_DATE FROM PS_LM_MGR_NOTF_TBL B , PS_LM_PERSON_NAME D , PS_LM_CI_VW2 C , PS_LM_ENRLMT_VW E WHERE B.LM_PERSON_ID = D.LM_PERSON_ID AND B.LM_ENRLMT_ID = E.LM_ENRLMT_ID AND E.LM_STTS IN ('ENRL', 'INPO') AND B.LM_CI_ID = C.LM_CI_ID AND D.LM_DISPLAY_FLAG = 'Y' AND %CurrentDateIn BETWEEN D.EFFDT AND D.LM_END_EFFDT AND ((D.LM_NAME_TYPE = 'PRF') OR (D.LM_NAME_TYPE = 'PRI' AND NOT EXISTS ( SELECT LM_NAME_TYPE FROM PS_LM_PERSON_NAME WHERE LM_PERSON_ID = D.LM_PERSON_ID AND LM_NAME_TYPE = 'PRF' AND %CurrentDateIn BETWEEN EFFDT AND LM_END_EFFDT)))
|