SELECT B.LM_MANAGER_ID , D.LM_NAME_DISPLAY , C.LM_CS_LONG_NM , B.LM_NUM_DAYS FROM PS_LM_MAND_NOT1_VW B , PS_LM_PERSON_NAME D , PS_LM_CI_VW2 C , PS_LM_ENRLMT A WHERE B.LM_PERSON_ID = D.LM_PERSON_ID AND A.LM_ENRLMT_ID = B.LM_ENRLMT_ID 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)))
|