Steven,
Like you need ( ) in algebra to deal with operator precedence, you need to do the same with logical operators. AND has higher precedence than OR, just like * has higher precedence than +.
x and y or z && x, y get AND'd first, then that result is OR'd with z
x or y and z && y, z AND'd, that result is OR'd with x
To get OR evaluated before AND you have to use ( )
x and ( y or z ) && y, z OR'd, then that result is AND'd with x
Another thing that happens in VFP though is there a boolean expression optimizer that will stop evaluating the expression once VFP has a result that won't change. ie
x = .t.
y = .f.
z = .t.
x and y and z && a, y AND'd to a .F. result, because the next operator is AND VFP won't even evaluate z
x or y or z && only x is evaluated, since it's .T. none of the rest of the expression is evaluated.
>How can I create an SQL statement that gets all records of one field value and the true condition of a second field or a not empty of a third field?