SELECT A.EMPLID ,A.INSTITUTION ,B.BUSINESS_UNIT ,A.STRM ,A.AID_YEAR ,SUM(-1 * A.NET_AWARD_AMT) FROM PS_ANTICIPATED_AID A , PS_STDNT_AWRD_DISB B WHERE A.NET_AWARD_AMT > 0 AND (A.DISB_EXPIRE_DT > %CurrentDateIn OR A.DISB_EXPIRE_DT IS NULL) AND A.EMPLID = B.EMPLID AND A.INSTITUTION = B.INSTITUTION AND A.AID_YEAR = B.AID_YEAR AND A.ITEM_TYPE = B.ITEM_TYPE AND A.ACAD_CAREER = B.ACAD_CAREER AND A.DISBURSEMENT_ID = B.DISBURSEMENT_ID AND A.AS_OF_DTTM=( SELECT MAX(AS_OF_DTTM) FROM PS_ANTICIPATED_AID C WHERE A.EMPLID = C.EMPLID AND A.INSTITUTION = C.INSTITUTION AND A.AID_YEAR = C.AID_YEAR AND A.ITEM_TYPE = C.ITEM_TYPE AND A.ACAD_CAREER=C.ACAD_CAREER AND A.DISBURSEMENT_ID=C.DISBURSEMENT_ID) GROUP BY A.EMPLID, A.INSTITUTION ,B.BUSINESS_UNIT, A.STRM, A.AID_YEAR
|