1: 2: 3:
if {Export.UserSchoolType} = "Infant" then {Export.PupilYearGroup} in [1 to 2] else if {Export.UserSchoolType} = "Junior" then {Export.PupilYearGroup} in [3 to 6] else if {Export.UserSchoolType} = "Primary" then {Export.PupilYearGroup} in [1 to 6]
WHERE ( Export.UserSchoolType = "Infant" AND Export.PupilYearGroup between 1 AND 2 ) OR ( Export.UserSchoolType = "Junior" AND Export.PupilYearGroup between 3 AND 6 ) OR ( Export.UserSchoolType = "Primary" AND Export.PupilYearGroup between 1 AND 6 )