SELECT A.COMPANY , B_LANG.LANGUAGE_CD , B_LANG.DESCR FROM PS_GPBR_C_PARM_SRC A , PS_COMPANY_TBL B , PS_COMPNY_TBL_LANG B_LANG , PS_GPBR_COMP_P_EFF C WHERE A.COMPANY = B.COMPANY AND C.COMPANY = B.COMPANY AND C.GPBR_COMP_STATUS = 'E' AND A.GPBR_ES_ADHERE = ( SELECT MAX(A2.GPBR_ES_ADHERE) FROM PS_GPBR_C_PARM_SRC A2 WHERE A.COMPANY = A2.COMPANY) AND B.EFFDT = ( SELECT MAX(B2.EFFDT) FROM PS_COMPANY_TBL B2 WHERE B2.COMPANY = B.COMPANY AND B2.EFFDT <= A.GPBR_ES_ADHERE) AND C.EFFDT = ( SELECT MAX(C2.EFFDT) FROM PS_GPBR_COMP_P_EFF C2 WHERE C2.COMPANY = C.COMPANY AND C2.EFFDT <= %CurrentDateIn) AND B_LANG.COMPANY = B.COMPANY AND B_LANG.EFFDT = B.EFFDT
|