# BAQ Filtering Question **Category:** [Epicor ERP 9](https://www.epiusers.help/c/e9/7) **Created:** 2016-11-02 15:15 UTC **Views:** 606 **Replies:** 2 **URL:** https://www.epiusers.help/t/baq-filtering-question/36064 --- ## Post #1 by @ahsalloum My scenario is that I am creating a BAQ toshow the entire Order, when one of the lines meets a particular OrderDtl.ProdCode. How would I go about filtering a BAQ to show me orders that have a particular OrderDtl.ProdCode when the order will have multiple ProdCode? For example, Order# XXX has 3 lines and 2 our of the 3 are for a prodcode of Chevy and one line that has a prodcode of Ford. I want to filter the BAQ to only show me orders that have a Ford Prodcode on the order and show me all 3 lines. Hope that makes sense --- ## Post #2 by @jdtrent I don't know if you can do subqueries in E9. If you can, you can sum the line numbers and act on a non-zero result. --- ## Post #3 by @Jim_Lutz I believe you would need to pull in the table a second time, as a summary table to show the order number and prodcode. Then inner join it by order number to the first instance of the table. --- **Canonical:** https://www.epiusers.help/t/baq-filtering-question/36064 **Original content:** https://www.epiusers.help/t/baq-filtering-question/36064