# BAQ Error

**URL:** <https://www.epiusers.help/t/baq-error/39054>\
**Category:** Epicor ERP 9\
**Created:** [June 28, 2017, 7:14pm UTC](https://www.epiusers.help/t/baq-error/39054 "2017-06-28T19:14:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kimberley](https://www.epiusers.help/user_avatar/www.epiusers.help/kimberley/32/50847_2.png) [@Kimberley](https://www.epiusers.help/u/Kimberley)\
**Post date:** [June 28, 2017, 7:14pm UTC](https://www.epiusers.help/t/baq-error/39054/1 "2017-06-28T19:14:57Z")

</div>

I am trying to do a simple BAQ and just have crazy issues. I am sure I am missing something simple.

I have PartBin and WhseBin (only non-netteable)

I am trying to sum the Parts on hand. They are in multiple bin locations and i get the following error. i am using TOTAL to calculate total On hand Qty.

_PartBin Company must be a quoted constant or an unabbreviated, unambiguous buffer/field reference for buffers known to query . (7328)_

---

<div class="post-metadata">

**Author:** ![jvalladares](https://www.epiusers.help/user_avatar/www.epiusers.help/jvalladares/32/2805_2.png) [@jvalladares](https://www.epiusers.help/u/jvalladares)\
**Post date:** [June 28, 2017, 7:47pm UTC](https://www.epiusers.help/t/baq-error/39054/2 "2017-06-28T19:47:32Z")

</div>

Is this total on hand per part per warehouse?  
Or total pieces on hand per bin?  
Or total pieces on hand per part per bin?

---

<div class="post-metadata">

**Author:** ![ckrusen](https://www.epiusers.help/user_avatar/www.epiusers.help/ckrusen/32/50584_2.png) [@ckrusen](https://www.epiusers.help/u/ckrusen)\
**Post date:** [June 28, 2017, 8:46pm UTC](https://www.epiusers.help/t/baq-error/39054/3 "2017-06-28T20:46:35Z")

</div>

Try first making the BAQ without summing up the QOH by Partnum.

The Query Phrase in E10 is

```
select 
	[PartBin].[PartNum] as [PartBin_PartNum],
	[PartBin].[BinNum] as [PartBin_BinNum],
	[PartBin].[OnhandQty] as [PartBin_OnhandQty],
	[WhseBin].[NonNettable] as [WhseBin_NonNettable]
from Erp.PartBin as PartBin
inner join Erp.WhseBin as WhseBin on 
	PartBin.Company = WhseBin.Company
And
	PartBin.WarehouseCode = WhseBin.WarehouseCode
And
	PartBin.BinNum = WhseBin.BinNum
 and ( WhseBin.NonNettable = FALSE )

```

If you can’t get that to work, try it without having the table criteria that filters on non-netable

If the query works, go back and remove the PartBin and Non-Nettable from the displayed fields. Then apply grouping by partnumber and add the calculated field for TOTAL(OnHandQty).

I know E10 is different, but your query phrase should look something like:

```
select 
	[PartBin].[PartNum] as [PartBin_PartNum],
	(SUM(PartBin.OnhandQty)) as [Calculated_QOHinNonNetable]
from Erp.PartBin as PartBin
inner join Erp.WhseBin as WhseBin on 
	PartBin.Company = WhseBin.Company
And
	PartBin.WarehouseCode = WhseBin.WarehouseCode
And
	PartBin.BinNum = WhseBin.BinNum
 and ( WhseBin.NonNettable = TRUE)

group by [PartBin].[PartNum]
```

---

<div class="post-metadata">

**Author:** ![Kimberley](https://www.epiusers.help/user_avatar/www.epiusers.help/kimberley/32/50847_2.png) [@Kimberley](https://www.epiusers.help/u/Kimberley)\
**Post date:** [June 28, 2017, 8:48pm UTC](https://www.epiusers.help/t/baq-error/39054/4 "2017-06-28T20:48:25Z")

</div>

I ended doing a View in SQl and creating an External BAQ.

Thanks
