Go da belirli bir Satış sipariş fişindeki sipariş kalemlerinin mamul alt malzemeleriyle çarpımı sonucu dış veri alarak excele aktarımı ...
(kısaca siparişe dayalı, malzeme ihtiyaç listesidir...) malzeme ihtiyaç planlaması yapan arkadaşlar için basit bir kurgu,
konunun süresi epey geçmiş ama denk geldim, başka birilerine faydası olur ümidiyle paylaşıyorum...
===============================================================================
SELECT LG_001_01_ORFICHE.FICHENO, LG_001_01_ORFICHE.DOCODE, LG_001_STCOMPLN.MAINCREF, LG_001_01_ORFICHE.DOCTRACKINGNR, LG_001_01_ORFICHE.DATE_, LG_001_01_ORFICHE.SPECODE, LG_001_CLCARD.CODE, LG_001_CLCARD.DEFINITION_, LG_001_01_ORFLINE.SPECODE, LG_001_STCOMPLN.LOGICALREF, LG_001_ITEMS_1.CODE, LG_001_ITEMS_1.NAME, LG_001_01_ORFLINE.AMOUNT, LG_001_01_ORFLINE.SHIPPEDAMOUNT, LG_001_01_ORFLINE.USREF, LG_001_01_ORFLINE.LINEEXP, LG_001_STCOMPLN.STCREF, LG_001_STCOMPLN.LINENO_, LG_001_ITEMS.CODE, LG_001_ITEMS.NAME, LG_001_STCOMPLN.AMNT, LG_001_STCOMPLN.LOSTFACTOR, LG_001_ITEMS.STGRPCODE, LG_001_ITEMS.PRODUCERCODE, LG_001_ITEMS.SPECODE, LG_001_ITEMS.SPECODE2, LG_001_ITEMS.SPECODE3, LG_001_ITEMS.SPECODE4, LG_001_ITEMS.SPECODE5
FROM GODATA.dbo.LG_001_01_ORFICHE LG_001_01_ORFICHE, GODATA.dbo.LG_001_01_ORFLINE LG_001_01_ORFLINE, GODATA.dbo.LG_001_CLCARD LG_001_CLCARD, GODATA.dbo.LG_001_ITEMS LG_001_ITEMS, GODATA.dbo.LG_001_ITEMS LG_001_ITEMS_1, GODATA.dbo.LG_001_STCOMPLN LG_001_STCOMPLN
WHERE LG_001_STCOMPLN.MAINCREF = LG_001_ITEMS_1.LOGICALREF AND LG_001_STCOMPLN.STCREF = LG_001_ITEMS.LOGICALREF AND LG_001_01_ORFICHE.LOGICALREF = LG_001_01_ORFLINE.ORDFICHEREF AND LG_001_STCOMPLN.MAINCREF = LG_001_01_ORFLINE.STOCKREF AND LG_001_CLCARD.LOGICALREF = LG_001_01_ORFICHE.CLIENTREF AND ((LG_001_01_ORFLINE.SPECODE='XSTOK ÜRETİMİ') AND (LG_001_01_ORFICHE.FICHENO='0000000000000117'))