SELECT C.EMPLID , C.COMPETENCY , J.REVIEW_POINTS , A.DESCR FROM %Table(COMPETENCIES) C , %Table(RS_EVALUATIONS) E , %Table(COMPETENCY_TBL) A , %Table(INSTALLATION_RS) I , %Table(RATING_MDL_TBL) K , %Table(REVW_RATING_TBL) J WHERE C.EFFDT = ( SELECT MAX(C2.EFFDT) FROM %Table(COMPETENCIES) C2 , %Table(RS_EVALUATIONS) E2 , %Table(INSTALLATION_RS) I2 WHERE E2.EMPLID = E.EMPLID AND E2.EVALUATION_TYPE = I2.EVALUATION_TYPE AND E2.REVIEW_STATUS = 'Y' AND C2.EMPLID = E2.EMPLID AND C2.EVALUATION_ID = E2.EVALUATION_ID AND C2.COMPETENCY = C.COMPETENCY AND C2.EFFDT <= %CurrentDateIn) AND E.EMPLID = C.EMPLID AND E.EVALUATION_ID = C.EVALUATION_ID AND E.EVALUATION_TYPE = I.EVALUATION_TYPE AND E.REVIEW_STATUS = 'Y' AND A.COMPETENCY = C.COMPETENCY AND A.RATING_MODEL = K.RATING_MODEL AND K.EFFDT = ( SELECT MAX(K2.EFFDT) FROM %Table(RATING_MDL_TBL) K2 WHERE K2.RATING_MODEL = K.RATING_MODEL AND K2.EFFDT <= C.EFFDT AND K2.EFF_STATUS = 'A') AND K.EFF_STATUS = 'A' AND J.RATING_MODEL = K.RATING_MODEL AND C.PROFICIENCY = J.REVIEW_RATING AND J.EFFDT = ( SELECT MAX(J2.EFFDT) FROM %Table(REVW_RATING_TBL) J2 WHERE J2.RATING_MODEL = J.RATING_MODEL AND J2.EFFDT <= C.EFFDT AND J2.REVIEW_RATING = J.REVIEW_RATING)
|