I have two tables (classes and students). Right now, I'm generating a
report in asp that shows a list of classes, the enrollment for each
class, and how many seats are available (see query below).
SELECT classes.classid, classes.classname, classes.maxstudents,
classes.Active COUNT(students.class) AS countstudentsclass,
classes.maxstudents - COUNT(students.class) AS remain FROM classes LEFT
OUTER JOIN students ON students.class = classes.classid GROUP BY
classes.classid, classes.classname, classes.maxstudents ORDER BY
classes.classid
Now, I want to filter out any class that has an Active value that = 0.
I've tried inserting WHERE classes.Active <> 0 in multiple places, but
I keep getting sytax error messages.
Can anyone help me figure this out? I'm new to SQL so please forgive
me.