BANKA EXTRESİ SQL SORGUSU

SELECT BNC.CODE + ' – ' + BNC.DEFINITION_ AS [Banka Kodu – Adı],
(SELECT CODE FROM LG_029_BANKACC WHERE LOGICALREF=BNL.BNACCREF) AS [Hesap Kodu],
BNL.LINEEXP AS [İşlem Açıklaması],
BNL.DATE_ AS Tarih, BNL.TRANNO AS [İşlem No.],
CASE bnl.TRCODE
WHEN 1 THEN 'Banka İşlem Fişi'                WHEN 2 THEN 'Banka Virman Fişi'
WHEN 3 THEN 'Gelen Havale-EFT'                WHEN 4 THEN 'Gönderilen EFT/Havale'
WHEN 5 THEN 'Banka Açılış Fişi'               WHEN 6 THEN 'Banka Kur Farkı Fişi'
WHEN 16 THEN 'Banka Alınan Hizmet Faturası'   WHEN 17 THEN 'Banka Verilen Hizmet Faturası'
WHEN 18 THEN 'Bankadan Çek Ödemesi'           WHEN 19 THEN 'Bankadan Senet Ödemesi'
END AS [İşlem Türü],

ISNULL(CASE WHEN BNL.SIGN = 0 AND BNL.TRCURR = 0 THEN BNL.TRNET END, 0) AS [Borç TL],
ISNULL(CASE WHEN BNL.SIGN = 1 AND BNL.TRCURR = 0 THEN BNL.TRNET END, 0) AS [Alacak TL],
ISNULL(CASE WHEN BNL.SIGN = 0 AND BNL.TRCURR = 1 THEN BNL.TRNET END, 0) AS [Borç $],
ISNULL(CASE WHEN BNL.SIGN = 1 AND BNL.TRCURR = 1 THEN BNL.TRNET END, 0) AS [Alacak $]

FROM LG_029_BNCARD AS BNC
LEFT OUTER JOIN LG_029_01_BNFLINE AS BNL ON BNC.LOGICALREF = BNL.BANKREF
LEFT OUTER JOIN LG_029_01_BNFICHE AS BNF ON BNF.LOGICALREF = BNL.SOURCEFREF
WHERE     (BNL.TRCODE IN (1, 2, 3, 4, 5, 6, 16, 17, 18, 19)) AND (BNL.TRANSTYPE NOT IN (3,2))

Yorumlar

Bu blogdaki popüler yayınlar

LOGO GO3 TEMEL ÖZELLİKLERİ