select NULL as [LOTSEQNBR], FG.BatchNo as [FGBATCH], FG.FormulaId as [FG], FG.[Labor Cost] as [FGLABOR], FG.[OverHead Cost] as [FGOH], FG.[Material Cost] as [FGMAT], FG.[Labor Cost] + FG.[OverHead Cost] + FG.[Material Cost] as [FGCOST], NULL as [FORMULA], NULL as [FORMULAMAT], NULL AS [FORUMLALABOR], NULL AS [FORMULAOH], NULL AS [Component], NULL as [LOT], NULL as [LOTQTY], NULL as [LOTUNITCOST] from BM_View_Dashboard_ProductionCostAnalysis FG INNER JOIN BM010115 BOM ON FG.FormulaId = BOM.PPN_I where FG.FormulaId = '506' and FG.BatchNo = '50418G12D' and BOM.SUBCAT_I = 1 UNION ALL select DISTINCT NULL as [LOTSEQNBR], NULL as [FGBATCH], NULL as [FG], NULL as [FGLABOR], NULL as [FGOH], NULL as [FGMAT], NULL as [FGCOST], BOM.PPN_I as [FORMULA], PROD.BatchMatCostActual as [FORMULAMAT], PROD.BatchLabortCostActual AS [FORMULALABOR], PROD.BatchOverHeadCostActual AS [FORMULAOH], --CASE WHEN PROD.BatchMatCostActual = 0 and PROD.BatchLabortCostActual = 0 and --PROD.BatchOverHeadCostActual = 0 --THEN INV.ITEMNMBR as [Component], NULL as [LOT], NULL as [LOTQTY], NULL as [LOTUNITCOST] from PNMAST PROD INNER JOIN BM010115 BOM ON PROD.FormulaId = BOM.PPN_I INNER JOIN BMMTrxHdr BMHDR ON PROD.BatchNo = BMHDR.BMDocNo INNER JOIN BMMTrxDtl BMDTL ON BMHDR.Dex_Row_Id = BMDTL.RefDex_Row_Id INNER JOIN IV30300 INV ON BMDTL.LNSeqNo = INV.LNSEQNBR where --PROD.FormulaId IN ('506N') BMHDR.IVDocNmbr IN ('081007', '081008', '081009') and INV.LNSEQNBR = 16384 and INV.ITEMNMBR IN ('506N', '1880', '1355') and INV.DOCTYPE = 1 --and INV.DOCNUMBR IN ('081007', '081008', '081009')
select * from BM010115 where PPN_I = '506'
select * from PNMAST where FormulaId = '506N'
Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.