BAQ Part to Buyer

Taking a step back to your original non-subquery solution, The duplicate rows would either be from having multiple revisions of a part that has a subcontract step, or a part having multiple subcontract steps. I am not the greatest at BAQs, here is a raw sql version that should solve your issue, hope this helps

SELECT pr.Company, pp.Plant, pr.PartNum, pr.RevisionNum, pp.BuyerID, pa.Name

FROM dbo.PartRev AS pr

INNER JOIN dbo.PartPlant AS pp
ON pr.Company = pp.Company AND
pr.Plant = pp.Plant AND
pr.PartNum = pp.PartNum

INNER JOIN dbo.PurAgent AS pa
ON pp.Company = pa.Company AND
pp.BuyerID = pa.BuyerID

WHERE pr.Approved = 1

--This only checks for the existence of a subcontract step on the BOO connected to the revision, removed duplicate rows
--from parts that have 2+ subcontract steps.
AND EXISTS (SELECT *
FROM dbo.PartOpr AS po
WHERE po.Company = pr.Company AND
po.PartNum = pr.PartNum AND
po.RevisionNum = pr.RevisionNum AND
po.AltMethod = pr.AltMethod AND
po.SubContract = 1)

ORDER BY Company, PartNum, RevisionNum, Plant

Ok that makes sense. Thank you.

Iā€™d like to be able my users to select which Site/Plant they want to see when initiating the report. How can I go about doing this?