====== Jostens School Wear Etc ====== SELECT P.studentNumber, I.lastName AS studentLastName, I.firstName AS studentFirstName, I.middleName AS studentMiddleName, E.grade, I.gender AS studentGender, C.email AS studentEmail, GI.lastName AS guardianLastName, GI.firstName AS guardianFirstName, GC.email AS guardianEmail, GC.cellPhone AS guardianCellPhone, GC.homePhone AS guardianHomePhone FROM Person P JOIN [Identity] I ON P.currentIdentityID = I.identityID JOIN Contact C ON P.personID = C.personID JOIN Enrollment E ON P.personID = E.personID JOIN Calendar Cal ON E.calendarID = Cal.calendarID AND Cal.summerSchool = 0 JOIN School S ON Cal.schoolID = S.schoolID AND S.exclude = 0 JOIN SchoolYear SY ON Cal.endYear = SY.endYear AND SY.active = 1 LEFT JOIN RelatedPair RP ON P.personID = RP.personID1 AND RP.guardian = 1 LEFT JOIN Person GP ON RP.personID2 = GP.personID LEFT JOIN [Identity] GI ON GP.currentIdentityID = GI.identityID LEFT JOIN Contact GC ON GP.personID = GC.personID WHERE E.grade IN('10','12') ORDER BY I.lastName, I.firstName