I created a BAQ for a search that selects active parts that have been run since 2016. My only selected field is Part Number and I have indicated “DISTINCT” within the subquery options to avoid multiple instances of the same part number.
When I run query within the BAQ Designer, I get distinct results. HOWEVER, when I run the actual BAQ Search within a search window, I get duplicate part numbers. Any thoughts? Is this just a limitation of BAQ searches?
select distinct
[Part].[PartNum] as [Part_PartNum]
from Erp.Part as Part
inner join Erp.JobHead as JobHead on
Part.Company = JobHead.Company
And
Part.PartNum = JobHead.PartNum
and ( JobHead.DueDate >= ‘1/1/2016’ )
where (Part.InActive = false)
order by Part.PartNum