SQL Sorgu Banka ve Muhasebe Bakiye Karşılaştırma

Murat OSMA

Yönetici
Site Yöneticisi
Katılım
25 May 2018
Mesajlar
1,247
En iyi yanıt
9
Puanları
113
Konum
İstanbul
Web sitesi
excelarsivi.com
Ad Soyad
Murat OSMA
Logo'da Banka ve Muhasebe Bakiye Karşılaştırma raporu için bu sorguyu kullanabilirsiniz.

[HIDEREPLYTHANKS]
SQL:
SELECT tablo.*, tablo.MODULBAKIYESI-tablo.MUHASEBETUTARI AS FARK FROM (
    SELECT (SELECT CODE FROM LG_214_BNCARD WHERE LOGICALREF=SUBE.BANKREF)BANKAKODU,
    (SELECT DEFINITION_ FROM LG_214_BNCARD WHERE LOGICALREF=SUBE.BANKREF)BANKAADI,
    SUBE.CODE SUBEKODU, SUBE.DEFINITION_ SUBEADI,
    ISNULL(ROUND((SELECT SUM(TOPLAM) FROM(
    SELECT SUM(AMOUNT-COSTTOT) TOPLAM FROM LG_214_01_BNFLINE WHERE
    BANKREF=SUBE.BANKREF AND BNACCREF=SUBE.LOGICALREF AND SIGN=0 AND CANCELLED=0
    UNION ALL
    SELECT -SUM(AMOUNT+COSTTOT)TOPLAM FROM LG_214_01_BNFLINE WHERE
    BANKREF=SUBE.BANKREF AND BNACCREF=SUBE.LOGICALREF AND SIGN=1 AND CANCELLED=0 )A),4),0)MODULBAKIYESI,
    (SELECT CODE FROM LG_214_EMUHACC WHERE LOGICALREF=(
    ISNULL((SELECT ACCOUNTREF FROM LG_214_CRDACREF WHERE TYP=1 AND TRCODE IN(6,18) AND CARDREF=SUBE.LOGICALREF),0)))MUHASEBEKODU,
    (SELECT DEFINITION_ FROM LG_214_EMUHACC WHERE LOGICALREF=(
    ISNULL((SELECT ACCOUNTREF FROM LG_214_CRDACREF WHERE TYP=1 AND TRCODE IN(6,18) AND CARDREF=SUBE.LOGICALREF),0)))MUHASEBEHESABI,
    (SELECT ISNULL(ROUND(SUM(DEBIT-CREDIT),2),0)TUTAR FROM LG_214_01_EMFLINE WHERE CANCELLED=0 AND ACCOUNTREF=(
    ISNULL((SELECT ACCOUNTREF FROM LG_214_CRDACREF WHERE TYP=1 AND TRCODE IN(6,18) AND CARDREF=SUBE.LOGICALREF),0)))MUHASEBETUTARI
FROM LG_214_BANKACC SUBE WHERE ACTIVE=0 ) tablo ORDER BY tablo.BANKAADI,tablo.SUBEADI
[/HIDEREPLYTHANKS]


Sonuç Tablo

bankabakiyelerikarsilastirma-min.png
 
Son düzenleme:

Hb1975

Yeni Üye
Katılım
10 Şub 2020
Mesajlar
4
En iyi yanıt
0
Puanları
1
Konum
Bursa
Ad Soyad
Hasan Başoğlu
Üst Alt