If you want people to help you, you need to state the question much more clearly than that. Most people aren’t going to work that hard to understand the question and then work, perhaps, even harder to answer it. That’s asking too much of people.
What DBMS are you using?
What error or undesirable behavior are you getting?
Are all those ?s supposed to be in your SQL?
Are those #s in your actual SQL?
The problem is in the AND clause?
Does it work if you don’t use an IN clause?