I get round similar situations by assigning the required values to variables, then creating a little function which you can use in the criteria of your query to retrieve the values – this may be an arse around tit way of doing it, but it works!
Create the variables in a new module, then build...