Query question: All parts with OPR1 and OPR2?

My brain is stuck. Connecting tables Part and PartOpr.

I want a BAQ that lists all of the part numbers that start with 910- and have both opcode “abcd” and opcode “efgh”. Some of these parts don’t have either of these operations, some only have opcode “abcd”, some only “efgh”, but I want the parts that have both “abcd” and “efgh”.

I do not know why I’m drawing a blank this morning. Subquery?

Many ways to skin this cat.

I would have a top level query with the part table, criteria filtering to parts that start with 910-

2 separate subqueries on the partopr table that filter for your 2 different op codes respectively.

Bring those into your top level and left join on part number and add in the opcode field from both subqueries.

Subquery criteria on the top level that says the opcode fields from both subqueries can’t be blank.

Beautiful. Just created and gives me the correct data!

How would I modify to get a single line for each operation so that this could turned into a DMT to update each of these two operations separately?

Thanks for your help!

Never mind. This works just fine for us. Thank you, again!