~[tlist_sql;select CC.Expression,
Courses.Course_Name,
case when tb.suppressltrgrd = 0 THEN pg.Grade ELSE NULL END||
case when tb.suppressltrgrd = 0 and tb.suppresspercentscr = 0 then ' ' END||
case when tb.suppresspercentscr = 0 THEN pg.percent ELSE NULL END grades,
cc.CurrentAbsences abs, cc.CurrentTardies tar,
Teachers.LastFirst, Sections.Room, Sections.ID, Sections.TermID
from Sections, Teachers, Courses, Terms, CC
LEFT OUTER JOIN PGFinalGrades pg
ON cc.SectionID = pg.SectionID
AND cc.StudentID = pg.StudentID
AND pg.FinalGradeName = '~[displaypref:curfgname-S~(curschoolid)]'
LEFT OUTER JOIN TERMBINS tb on pg.finalgradename=tb.storecode and cc.schoolid=tb.schoolid and cc.termid = tb.termid
where ABS(CC.SectionID) = Sections.ID
and Sections.Teacher = Teachers.ID
and Courses.Course_Number = Sections.Course_Number
and Terms.ID = Sections.TermID
and Terms.SchoolID = Sections.SchoolID
;alternatecolor;currentschedule]