You should probably be posting your question here.
Anyway, let's look at your problem from a logical standpoint.
Your WHERE clause
What I usually do is, I split "AND" conditions by row, and "OR" conditions in the same row. So it would look like this for you
When split like this, it is visually easy to spot what went wrong.
I assume you want it to be a TRANSACTION_TYPE of "4" or "5" and it must have VAT_CODE of "4"?
So it should look like this:
And when you want to combine it back to a single line, always bracket "OR" conditions (as shown above).
Bookmarks