this is your WHERE clause --
Code:
WHERE B.date BETWEEN '2009-05-17 00:00:00'
AND '2009-08-30 23:59:59' -- this is c1
AND A.nearestTown = 143 -- this is c2
OR A.otherWorkableTowns LIKE '|143|' -- this is c3
AND B.status = 1 -- this is c4
AND shedPreference = 'Rotary' -- this is c5
AND skillSet = 'Sole Charge or Assistant' -- this is c6
AND milkingExperience = '0-1 years' -- this is c7
AND age = '18 and under' -- this is c8
so this is equivalent to --
Code:
WHERE c1 AND c2 OR c3 AND c4 AND c5 AND c6 AND c7 AND c8
okay, now, ANDs take precedence over ORs, so this is evaluated as follows --
Code:
WHERE ( c1 AND c2 )
OR ( c3 AND c4 AND c5 AND c6 AND c7 AND c8)
however, i'd be willing to bet that what you want is this --
Code:
WHERE c1 AND ( c2 OR c3 ) AND c4 AND c5 AND c6 AND c7 AND c8
tip: when mixing ANDs and ORs, always code your own parentheses to get the logical evaluation you need
