tegb,
In the SQL marked in red, you reference [XNAC2],
but at the start you say you have (XNAC & XNAC1).
Also, your logic you may need parentheses in your Where clause.
You have --> A or B and C and D.
I think you should have --> (A or B) and C and D
As it currently is, you'll return all...