The tables and joins
This is not what you asked about, but I thought I'd explain since there is some wacky stuff here.Joining PartBin to Warehouse:
Joining Warehouse to PartPlant
Criteria on PartPlant
Parameter
The magic
This is how I do filters. I make a calculated field - typically named this obvious - and do all the logic in it.All of that was in a SubQuery.
Then I make a top-level query that filters by my calculated column.