SELECT A.EMPLID , A.AID_YEAR , D.INSTITUTION , SUM(A.EXPECTED_AWARD) , SUM(A.ACTUAL_AWARD) FROM PS_STDNT_AGGR_SCHL A , PS_AGGR_LIMIT_TBL B , PS_INST_SCHOOL_CDS D WHERE A.AGGREGATE_AREA = B.AGGREGATE_AREA AND A.AID_YEAR = B.AID_YEAR AND A.AID_YEAR = D.AID_YEAR AND A.CPS_SCHOOL_CODE = D.CPS_SCHOOL_CODE AND B.EFFDT = ( SELECT MAX(B1.EFFDT) FROM PS_AGGR_LIMIT_TBL B1 WHERE B1.AGGREGATE_AREA = B.AGGREGATE_AREA AND B1.AID_YEAR = B.AID_YEAR AND B1.EFFDT <= %CurrentDateIn) AND B.EFF_STATUS = 'A' AND B.FEDERAL_ID = 'PERK' AND A.EXPECTED_AWARD > 0 GROUP BY A.EMPLID , A.AID_YEAR , D.INSTITUTION
|