Indeed, and if that still is not resolved, think abouit the two conditions about scode. It's correct to OR them, but you want this to happen first (OR operations done before AND operations), while this operation is done last. Put brackets around that:
[tt]a AND (b OR c) AND d[/tt] forces the correct order of operations for your conditions. Without the brackets there the execution is in reverse order, meaning (a AND b) OR (c AND d) is executed, which can be true, even if d is false, in the case I showed, where a and b are true, thus c and d don't matter anymore.
You only have three real conditions:
1. id_no matches a certain value
2. scode matches one of two values
3. grade is ok
You want to combine these three with AND, you need to OR the two partial conditions of 2 (because no code can match two other codes, only one of them) and therefore need put brackets around the whole second condition.
Bye, Olaf.