bhonda - 12:23 pm on Dec 21, 2012 (gmt 0)
Be careful with mixing AND and OR in the same statement without using brackets.
I would assume you want something like -
(MINUTES IS NOT NULL AND MINUTES='60')
(MINUTES IS NOT NULL AND MINUTES='30' AND DESCRIPTION NOT LIKE '%Test%')
Because this is different and will return completely different results -
(MINUTES IS NOT NULL AND MINUTES='60' OR MINUTES IS NOT NULL)
MINUTES='30' AND DESCRIPTION NOT LIKE '%Test%'
Using a mix of AND and OR in the same statement relies on them being interpreted in a specific order, and it's never clear just by looking at the statement how it's going to work.
It's like in maths, what is the result of -
3 + 5 * 2?
Depending on the order in which you make the calculations, the result is either 16 or 13.
Whereas using brackets, you can ask -
3 + (5 * 2)
(3 + 5) * 2
Likewise, make sure you always explicitly define what is being compared with AND and what is being compared with OR.