Jose C Gomez
T: 904.469.1524 mobile
Quis custodiet ipsos custodes?
On Wed, Jan 27, 2016 at 12:37 PM, Jose Gomez <jose@...> wrote:This isn't a BAQ issues as much as a SQL issue. One or more of your joins is causing you to get duplicate data. Most of the time looking at your joins will fix the issue, however there are times where the data is indeed duplicated. In this case you need to add a group by clause or a select distinct to your query.ÂOn Wed, Jan 27, 2016 at 11:46 AM, brandonanderson7979@... [vantage] <vantage@yahoogroups.com> wrote:Â<div> <p>Hi,<br><br>So I am learning how to write BAQ's and I'm trying to get my first one to work. I apologize if this question has been asked before, but I find this forum extremely hard to find old posts that are relevant. Anyways....<br><br>I am trying to create a pick list for assembly (by job). Below I copied BAQ. The job number for testing is 040017-1-hd, later I'll figure out how to make that so you type in what job you want.<br><br>The issue that I am having is, I am getting duplicate returns. I get 372 lines, but 189 are duplicates so I should only be receiving 183 lines. It's looks like it's always 2 entries when they are duplicated, but it's not every record. Some come in as expected. Is this a common problem with a common troubleshooting technique? Or is there some group function that I should be using but can't find, (although I still don't know why I would receive duplicate returns.)<br><br>Let me know if you need more details. (or more likely, let me know <span style="font-style:italic;">what</span><span> details you need because I'm sure that I am not explaining myself very well.)</span><br></p><p><br></p><p>Brandon<br><span></span></p><p><br><span></span></p><p><span>select <br>Â Â Â [JobAsmbl].[AssemblySeq] as [JobAsmbl_AssemblySeq],<br>Â Â Â [JobAsmbl].[PartNum] as [JobAsmbl_PartNum],<br>Â Â Â [JobAsmbl].[Description] as [JobAsmbl_Description],<br>Â Â Â [JobAsmbl].[QtyPer] as [JobAsmbl_QtyPer],<br>Â Â Â [JobAsmbl1second].[PartNum] as [JobAsmbl1second_PartNum],<br>Â Â Â [JobAsmbl1second].[Description] as [JobAsmbl1second_Description],<br>Â Â Â [JobAsmbl1second].[QtyPer] as [JobAsmbl1second_QtyPer],<br>Â Â Â [PartOpDtl].[ResourceGrpID] as [PartOpDtl_ResourceGrpID],<br>Â Â Â [PartBin].[WarehouseCode] as [PartBin_WarehouseCode],<br>Â Â Â [PartBin].[BinNum] as [PartBin_BinNum]<br>from Erp.JobAsmbl as JobAsmbl<br>inner join Erp.JobAsmbl as JobAsmbl1second on <br>Â Â Â JobAsmbl.AssemblySeq = JobAsmbl1second.Parent<br><br>inner join Erp.PartOpDtl as PartOpDtl on <br>Â Â Â JobAsmbl.PartNum = PartOpDtl.PartNum<br>Â and ( PartOpDtl.ResourceGrpID = 'assembly'Â )<br><br>left outer join Erp.PartBin as PartBin on <br>Â Â Â JobAsmbl1second.PartNum = PartBin.PartNum<br><br>Â where (JobAsmbl.JobNum = '040017-1-hd')<br></span></p><p><span><br></span></p><p></p> </div> <div style="color:#fff;min-height:0;"></div>