The following SQL query will retrieve student course history with their grade level at the time the course was taken.

SELECT EA7STUDENTCOURSETERMS.ENROLLMENTSTATUS, EA7RECORDS.USERDEFINEDID, EA7RECORDS.FIRSTNAME, EA7RECORDS.LASTNAME,
       EA7STUDENTCOURSETERMS.EA7TERMSID, EA7SESSIONS.EA7ACADEMICYEARSID, EA7ACADEMICYEARS.YEARID, EA7ACADEMICYEARS.DESCRIPTION AS Expr2,
       T1.DESCRIPTION, EA7COURSES.COURSENAME, EA7COURSES.COURSEID, EA7COURSES.DESCRIPTION AS Expr1, T2.DESCRIPTION as 'GRADE LEVEL', T2.LONGPROPERCASETRANSLATION

FROM EA7STUDENTCOURSES
LEFT OUTER JOIN EA7STUDENTCOURSETERMS ON EA7STUDENTCOURSES.EA7STUDENTCOURSESID = EA7STUDENTCOURSETERMS.EA7STUDENTCOURSESID
LEFT OUTER JOIN EA7STUDENTS EAS1 ON EA7STUDENTCOURSES.EA7STUDENTSID = EAS1.EA7STUDENTSID
LEFT OUTER JOIN EA7RECORDS ON EAS1.EA7RECORDSID = EA7RECORDS.EA7RECORDSID
LEFT OUTER JOIN EA7RECORDSTATUSLOGS ON EA7RECORDS.EA7RECORDSID = EA7RECORDSTATUSLOGS.EA7RECORDSID
LEFT OUTER JOIN EA7SESSIONS ON EA7STUDENTCOURSES.EA7SESSIONSID = EA7SESSIONS.EA7SESSIONSID
LEFT OUTER JOIN EA7ACADEMICYEARS ON EA7SESSIONS.EA7ACADEMICYEARSID = EA7ACADEMICYEARS.EA7ACADEMICYEARSID
LEFT OUTER JOIN EA7PROMOTIONSUMMARIES EAP ON
(EA7ACADEMICYEARS.EA7ACADEMICYEARSID = EAP.EA7ACADEMICYEARSID AND EAS1.EA7STUDENTSID = EAP.EA7STUDENTSID)
LEFT OUTER JOIN TABLEENTRIES T2 ON EAP.GRADELEVEL = T2.TABLEENTRIESID
LEFT OUTER JOIN EA7TERMS ON EA7STUDENTCOURSETERMS.EA7TERMSID = EA7TERMS.EA7TERMSID AND EA7SESSIONS.EA7SESSIONSID = EA7TERMS.EA7SESSIONSID
LEFT OUTER JOIN TABLEENTRIES T1 ON EA7TERMS.TERMID = T1.TABLEENTRIESID
LEFT OUTER JOIN EA7COURSES ON EA7STUDENTCOURSES.EA7COURSESID = EA7COURSES.EA7COURSESID

WHERE (EA7RECORDSTATUSLOGS.STATUS = ##) AND --replace ## is desired status number
(EA7RECORDSTATUSLOGS.ISCURRENT = - 1) and (EA7STUDENTCOURSETERMS.ENROLLMENTSTATUS = 2)
ORDER BY EA7RECORDS.LASTNAME, EA7RECORDS.FIRSTNAME, EA7SESSIONS.EA7ACADEMICYEARSID, EA7STUDENTCOURSETERMS.EA7TERMSID