İstek TAHSİL ÇEK SORGU

BURHAN KIDIR

Yeni Üye
Katılım
3 Eki 2020
Mesajlar
16
En iyi yanıt
0
Puanları
1
Yaş
34
Konum
BATMAN
Ad Soyad
BURHAN KIDIR
Merhaba,

Aşağıdaki şekilde bir raporum var, bu rapora iş yeri eklemek istiyorum yardımcı olur musunuz?

SQL:
SELECT     CSC.DUEDATE, YEAR(CSC.DUEDATE) AS Yıl, CASE MONTH(CSC.DUEDATE)
                      WHEN 1 THEN 'Ocak' WHEN 2 THEN 'Şubat' WHEN 3 THEN 'Mart' WHEN 4 THEN 'Nisan' WHEN 5 THEN 'Mayıs' WHEN 6 THEN 'Haziran' WHEN 7 THEN 'Temmuz' WHEN
                       8 THEN 'Ağustos' WHEN 9 THEN 'Eylül' WHEN 10 THEN 'Ekim' WHEN 11 THEN 'Kasım' WHEN 12 THEN 'Aralık' END AS Aylar, CSR.DATE_ AS [İşlem Tarihi],
                      CSC.PORTFOYNO AS [Pört No], CSC.NEWSERINO AS [Seri No], CSC.AMOUNT, CASE (CSc.CURRSTAT)
                      WHEN 4 THEN 'Tahsile Verildi' WHEN 2 THEN 'Ciro Edildi' WHEN 1 THEN 'Pörtföyde' WHEN 3 THEN 'Teminata Verildi' WHEN 8 THEN 'Tahsil Edildi' WHEN 5 THEN 'Tahsile Verildi (Protestolu)'
                       WHEN 6 THEN 'İade Edildi' WHEN 7 THEN 'Protesto Edildi' WHEN 11 THEN 'Karşılığı Yok' WHEN 12 THEN 'Tahsil Edilemiyor' WHEN 13 THEN 'Portföyde Karşılıksız' WHEN
                       14 THEN 'Portföyde Protestolu' WHEN 9 THEN 'Kendi Çekimiz' END AS Durumu, CSC.OWING AS Borçlu, CASE WHEN ISNULL(CLC.CODE, '')
                      <> '' THEN CLC.DEFINITION_ ELSE
                          (SELECT     CLC1.DEFINITION_
                            FROM          LG_226_CLCARD CLC1
                            WHERE      CLC1.LOGICALREF =
                                                       (SELECT     TOP 1 CTS1.CARDREF
                                                         FROM          LG_226_01_CSTRANS CTS1
                                                         WHERE      CTS1.STATUS = 1 AND CTS1.CSREF = CST.CSREF
                                                         ORDER BY CTS1.LOGICALREF ASC)) END AS [CH Adı], CSC.BANKNAME AS [Çekin Bankası], ISNULL(ISNULL(BNK.DEFINITION_, BNK1.DEFINITION_),
                      CSC.BANKNAME) AS [Banka Adı], CASE WHEN ISNULL(CLC.CODE, '') <> '' THEN CLC.CITY ELSE
                          (SELECT     CLC1.CITY
                            FROM          LG_226_CLCARD CLC1
                            WHERE      CLC1.LOGICALREF =
                                                       (SELECT     TOP 1 CTS1.CARDREF
                                                         FROM          LG_226_01_CSTRANS CTS1
                                                         WHERE      CTS1.STATUS = 1 AND CTS1.CSREF = CST.CSREF
                                                         ORDER BY CTS1.LOGICALREF ASC)) END AS Şehir, dbo.LG_SLSMAN.DEFINITION_ AS [Satış Elemanı]
FROM         dbo.LG_SLSMAN RIGHT OUTER JOIN
                      dbo.LG_226_01_CSCARD AS CSC ON dbo.LG_SLSMAN.LOGICALREF = CSC.SALESMANREF RIGHT OUTER JOIN
                      dbo.LG_226_01_CSTRANS AS CST ON CSC.LOGICALREF = CST.CSREF LEFT OUTER JOIN
                      dbo.LG_226_01_CSROLL AS CSR ON CSR.LOGICALREF = CST.ROLLREF LEFT OUTER JOIN
                      dbo.LG_226_CLCARD AS CLC ON CLC.LOGICALREF = CST.CARDREF LEFT OUTER JOIN
                      dbo.LG_226_BANKACC AS BNC ON BNC.LOGICALREF = CSC.OURBANKREF LEFT OUTER JOIN
                      dbo.LG_226_BNCARD AS BNK ON BNK.LOGICALREF = BNC.BANKREF LEFT OUTER JOIN
                      dbo.LG_226_BANKACC AS BNC1 ON BNC1.LOGICALREF = CST.CARDREF LEFT OUTER JOIN
                      dbo.LG_226_BNCARD AS BNK1 ON BNK1.LOGICALREF = BNC1.BANKREF
 
Moderatör tarafında düzenlendi:
Üst Alt