Bu sorguyu incele, Stok toplam tablosu LG_FirmaNo_DönemNo_GNTOTST
SELECT TOP 100 PERCENT dbo.LG_507_ITEMS.CODE AS Kodu, dbo.LG_507_ITEMS.NAME AS Açıklama,
dbo.LG_507_01_GNTOTST.TRANSFERRED AS [Onceki Donem Devri], dbo.LG_507_01_GNTOTST.PURAMNT AS [Satinalma Miktari],
dbo.LG_507_01_GNTOTST.SALAMNT AS [Satis Miktari], dbo.LG_507_01_GNTOTST.ONHAND AS Mevcut,
dbo.LG_507_01_GNTOTST.ACTWHOUSEIN AS [Gerceklesen Ambar Girisleri],
dbo.LG_507_01_GNTOTST.ACTWHOUSEOUT AS [Gerceklesen Ambar Cikislari], dbo.LG_507_ITEMS.LOGICALREF
FROM dbo.LG_507_ITEMS LEFT OUTER JOIN
dbo.LG_507_01_GNTOTST ON dbo.LG_507_ITEMS.LOGICALREF = dbo.LG_507_01_GNTOTST.STOCKREF
WHERE (dbo.LG_507_01_GNTOTST.INVENNO = - 1)
ORDER BY dbo.LG_507_ITEMS.CODE