Select using multiple check text boxes
Posted on 2008-10-12
I am using access and asp.
I want to use 4 check boxes to allow users to choose what to view. What should my sql be to allow for all combinations?
The check boxes are called L1, L2, L3, L4.
This is my SQL at the moment
SELECT TOP " & Request("myNumber") & " tblPupil.PupilID, Count(tblBehaviour.ID) AS mytotal, tblPupil.Surname, tblPupil.FirstName FROM tblPupil INNER JOIN tblBehaviour ON tblPupil.PupilID = tblBehaviour.PupilID WHERE (([Level] = 'L1' OR [Level] = 'L2' OR [Level] = 'L3' OR [Level] = 'L4') AND tblPupil.TutorGroup LIKE '" & Request("myYear") & "%') GROUP BY tblPupil.PupilID, tblPupil.Surname, tblPupil.FirstName ORDER BY Count(tblBehaviour.ID) DESC
This shows all Levels. I want to display L1, L2, L3 and L4 based on the user choice of checking the check boxes.