SELECT DISTINCT A.COMPANY , A.PAYGROUP , B.ERNCD , D.LANGUAGE_CD , D.DESCR FROM PS_PAYGROUP_TBL A , PS_ERN_PROGRAM_DEF B , PS_EARNINGS_TBL C , PS_EARNINGS_LANG D WHERE A.EFFDT = ( SELECT MAX(A_ED.EFFDT) FROM PS_PAYGROUP_TBL A_ED WHERE A.COMPANY = A_ED.COMPANY AND A.PAYGROUP = A_ED.PAYGROUP AND A_ED.EFFDT <= %CurrentDateIn) AND B.ERN_PROGRAM = A.ERN_PROGRAM AND B.EFFDT = ( SELECT MAX(B_ED.EFFDT) FROM PS_ERN_PROGRAM_DEF B_ED WHERE B.ERN_PROGRAM = B_ED.ERN_PROGRAM AND B_ED.EFFDT <= %CurrentDateIn) AND B.ERNCD = C.ERNCD AND C.EFF_STATUS = 'A' AND C.PAYMENT_TYPE <> 'S' AND C.EFFDT = ( SELECT MAX(C_ED.EFFDT) FROM PS_EARNINGS_TBL C_ED WHERE C.ERNCD = C_ED.ERNCD AND C_ED.EFFDT <= %CurrentDateIn) AND D.ERNCD = C.ERNCD AND D.EFFDT = C.EFFDT
|