This is the code from the baq.
select
[PartWhse].[WarehouseCode] as [PartWhse_WarehouseCode],
[PartWhse].[Company] as [PartWhse_Company],
[PartWhse].[PartNum] as [PartWhse_PartNum],
[PartWhse].[ManualABC] as [PartWhse_ManualABC],
[PartWhse].[SystemAbc] as [PartWhse_SystemAbc],
[Warehse].[Plant] as [Warehse_Plant],
(sum(PartCost.AvgLaborCost+PartCost.AvgBurdenCost+PartCost.AvgMaterialCost+PartCost.AvgSubContCost)) as [Calculated_PartCosts],
[Part].[ClassID] as [Part_ClassID],
[Part].[Company] as [Part_Company]
from Erp.PartWhse as PartWhse
left outer join Erp.Warehse as Warehse on
PartWhse.Company = Warehse.Company
and PartWhse.KBWarehouseCode = Warehse.WarehouseCode
right outer join Erp.PartCost as PartCost on
PartCost.PartNum = PartWhse.PartNum
left outer join Erp.Part as Part on
PartWhse.Company = Part.Company
and PartWhse.PartNum = Part.PartNum
where (PartWhse.WarehouseCode = ‘FGA’ or PartWhse.WarehouseCode = ‘FG’ or PartWhse.WarehouseCode = ‘SKIN-C’ or PartWhse.WarehouseCode = ‘TOOL-IN’ or PartWhse.WarehouseCode = ‘DROP’ or PartWhse.WarehouseCode = ‘ASSEM’ or PartWhse.WarehouseCode = ‘C-FG’ or PartWhse.WarehouseCode = ‘CENTRAL’ or PartWhse.WarehouseCode = ‘CR’ or PartWhse.WarehouseCode = ‘HDW’ or PartWhse.WarehouseCode = ‘T-TLCRIB’ or PartWhse.WarehouseCode = ‘HYDRO’ or PartWhse.WarehouseCode = ‘SEALANT’ and PartWhse.OnHandQty > ‘0’)
group by [PartWhse].[WarehouseCode],
[PartWhse].[Company],
[PartWhse].[PartNum],
[PartWhse].[ManualABC],
[PartWhse].[SystemAbc],
[Warehse].[Plant],
[Part].[ClassID],
[Part].[Company]
having (sum(PartCost.AvgLaborCost+PartCost.AvgBurdenCost+PartCost.AvgMaterialCost+PartCost.AvgSubContCost)) > ‘500.00’
Any help would be appreciated.