Blog Of Sem: LOGO LKS2 SQL Anlik Sanal Satislar

LOGO LKS2 SQL Anlik Sanal Satislar

SELECT     TOP 100 PERCENT dbo.LG_114_01_INVOICE.DATE_ AS TARİH, dbo.LG_114_01_INVOICE.FICHENO AS [FATURA NO],
                      dbo.LG_SLSMAN.DEFINITION_ AS [SATIŞ ELEMANI], dbo.LG_114_CLCARD.DEFINITION_ AS [CARİ HESAP ÜNVANI],
                      dbo.LG_114_ITEMS.NAME AS [ÜRÜN ADI], dbo.LG_114_01_STLINE.AMOUNT AS ADET, dbo.LG_114_01_STLINE.VATMATRAH AS TUTAR,
                      dbo.LG_114_01_INVOICE.GENEXP1 AS [FATURA AÇIKLAMA]
FROM         dbo.LG_114_01_INVOICE INNER JOIN
                      dbo.LG_114_01_STLINE ON dbo.LG_114_01_INVOICE.LOGICALREF = dbo.LG_114_01_STLINE.INVOICEREF INNER JOIN
                      dbo.LG_114_CLCARD ON dbo.LG_114_01_INVOICE.CLIENTREF = dbo.LG_114_CLCARD.LOGICALREF INNER JOIN
                      dbo.LG_114_ITEMS ON dbo.LG_114_01_STLINE.STOCKREF = dbo.LG_114_ITEMS.LOGICALREF INNER JOIN
                      dbo.LG_SLSMAN ON dbo.LG_114_01_INVOICE.SALESMANREF = dbo.LG_SLSMAN.LOGICALREF
WHERE      (dbo.LG_114_ITEMS.CODE = KK 01') OR

           

(dbo.LG_114_ITEMS.CODE = KK 05') OR
(dbo.LG_114_ITEMS.CODE = KK 06') OR
(dbo.LG_114_ITEMS.CODE = KK 06_2') OR
(dbo.LG_114_ITEMS.CODE = KK 06_3') OR
(dbo.LG_114_ITEMS.CODE = KK 07') OR
(dbo.LG_114_ITEMS.CODE = KK 08') OR
(dbo.LG_114_ITEMS.CODE = KK 09') OR
(dbo.LG_114_ITEMS.CODE = KK 10') OR
(dbo.LG_114_ITEMS.CODE = KK 11') OR

(dbo.LG_114_ITEMS.CODE = KK 12') OR
(dbo.LG_114_ITEMS.CODE = KK 12_1') OR
(dbo.LG_114_ITEMS.CODE = KK 13') OR
(dbo.LG_114_ITEMS.CODE = KK 13_2') OR
(dbo.LG_114_ITEMS.CODE = KK 13_3') OR
(dbo.LG_114_ITEMS.CODE = KK 14') OR
(dbo.LG_114_ITEMS.CODE = KK 15') OR
(dbo.LG_114_ITEMS.CODE = KK 16') OR
(dbo.LG_114_ITEMS.CODE = KK 16_1') OR
(dbo.LG_114_ITEMS.CODE = KK 17') OR
(dbo.LG_114_ITEMS.CODE = KK 17_1') OR
(dbo.LG_114_ITEMS.CODE = KK 17_2') OR
(dbo.LG_114_ITEMS.CODE = KK 17_3') OR
(dbo.LG_114_ITEMS.CODE = KK 17_4') OR
(dbo.LG_114_ITEMS.CODE = KK 17_5') OR
(dbo.LG_114_ITEMS.CODE = KK 17_6') OR
(dbo.LG_114_ITEMS.CODE = KK 17_7') OR
(dbo.LG_114_ITEMS.CODE = KK 36_0')

GROUP BY dbo.LG_114_01_INVOICE.DATE_, dbo.LG_114_01_INVOICE.FICHENO, dbo.LG_114_01_INVOICE.TIME_, dbo.LG_114_CLCARD.DEFINITION_,
                      dbo.LG_114_ITEMS.NAME, dbo.LG_SLSMAN.DEFINITION_, dbo.LG_114_01_STLINE.AMOUNT, dbo.LG_114_01_STLINE.VATMATRAH,
dbo.LG_114_01_INVOICE.CAPIBLOCK_CREATEDHOUR,dbo.LG_114_01_INVOICE.CAPIBLOCK_CREATEDMIN,dbo.LG_114_01_INVOICE.CAPIBLOCK_CREATEDSEC,
                      dbo.LG_114_01_INVOICE.GENEXP1
HAVING      (dbo.LG_114_01_INVOICE.DATE_ >= CONVERT(DATETIME, '2013-09-01 00:00:00', 102))
ORDER BY dbo.LG_114_01_INVOICE.DATE_, dbo.LG_114_01_INVOICE.CAPIBLOCK_CREATEDHOUR,dbo.LG_114_01_INVOICE.CAPIBLOCK_CREATEDMIN,dbo.LG_114_01_INVOICE.CAPIBLOCK_CREATEDSEC

No comments:

Post a Comment