SELECT DISTINCT A.COMPANY , CAL.PAY_END_DT , CAL.PAY_BEGIN_DT , X.LANGUAGE_CD , X.XLATSHORTNAME FROM PS_GVT_JOB A , PS_GVT_PERS_DATA B , PS_GVT_EMPLOYMENT C , PS_GVT_PERS_NID D , PS_PAY_EARNINGS E , PS_PAY_CALENDAR CAL , PSXLATITEMLANG X WHERE A.GVT_ANN_IND IN ('1', '4', '5', 'A', 'C', 'E') AND A.EFFDT = ( SELECT MAX(A1.EFFDT) FROM PS_GVT_JOB A1 WHERE A1.EMPLID = A.EMPLID AND A1.EMPL_RCD = A.EMPL_RCD AND A1.GVT_ANN_IND IN ('1', '4', '5', 'A', 'C', 'E') AND A1.EFFDT <= CAL.PAY_END_DT) AND A.EFFSEQ = ( SELECT MAX(A2.EFFSEQ) FROM PS_GVT_JOB A2 WHERE A2.EMPLID = A.EMPLID AND A2.EMPL_RCD = A.EMPL_RCD AND A2.GVT_ANN_IND IN ('1', '4', '5', 'A', 'C', 'E') AND A2.EFFDT = A.EFFDT) AND B.EMPLID = A.EMPLID AND B.EMPL_RCD = A.EMPL_RCD AND B.EFFDT = A.EFFDT AND B.EFFSEQ = A.EFFSEQ AND C.EMPLID = A.EMPLID AND C.EMPL_RCD = A.EMPL_RCD AND C.EFFDT = A.EFFDT AND C.EFFSEQ = A.EFFSEQ AND D.EMPLID = A.EMPLID AND D.EMPL_RCD = A.EMPL_RCD AND D.EFFDT = A.EFFDT AND D.EFFSEQ = A.EFFSEQ AND E.EMPLID = A.EMPLID AND E.COMPANY = A.COMPANY AND E.PAYGROUP = A.PAYGROUP AND X.FIELDNAME = 'GVT_WORK_SCHED' AND X.FIELDVALUE = A.GVT_WORK_SCHED AND %EffdtCheck(PSXLATITEMLANG L, X, A.EFFDT) AND CAL.COMPANY = A.COMPANY AND CAL.PAY_END_DT = E.PAY_END_DT
|