arkadaslar kimseden cıt cıkmayınca biraz araştırdım sitenizi ve table larla ilgili bilgi aldım.
ve aşağıdaki kodu yazdım bundan sonrası için biraz yardım alabilir miyim öncelikle doğru bir yoldamıyım.
SELECT
LG_001_CLCARD.CODE AS [Cari Kodu],
LG_001_CLCARD.DEFINITION_ AS [Ünvanı],
LG_001_01_CLTOTFIL.MONTH_ AS [Ay],
CASE WHEN (LG_001_01_CLTOTFIL.MONTH_ = 1) THEN 'OCAK'
WHEN (LG_001_01_CLTOTFIL.MONTH_ = 2) THEN 'ŞUBAT'
WHEN (LG_001_01_CLTOTFIL.MONTH_ = 3) THEN 'MART'
WHEN (LG_001_01_CLTOTFIL.MONTH_ = 4) THEN 'NİSAN'
WHEN (LG_001_01_CLTOTFIL.MONTH_ = 5) THEN 'MAYIS'
WHEN (LG_001_01_CLTOTFIL.MONTH_ = 6) THEN 'HAZİRAN'
WHEN (LG_001_01_CLTOTFIL.MONTH_ = 7) THEN 'TEMMUZ'
WHEN (LG_001_01_CLTOTFIL.MONTH_ =
THEN 'AĞUSTOS'
WHEN (LG_001_01_CLTOTFIL.MONTH_ = 9) THEN 'EYLÜL'
WHEN (LG_001_01_CLTOTFIL.MONTH_ = 10) THEN 'EKİM'
WHEN (LG_001_01_CLTOTFIL.MONTH_ = 11) THEN 'KASIM'
WHEN (LG_001_01_CLTOTFIL.MONTH_ = 12) THEN 'ARALIK'
END AS [AyAdı],
SUM (LG_001_01_CLTOTFIL.DEBIT) AS [Borç],
SUM (LG_001_01_CLTOTFIL.CREDIT) AS [Alacak],
SUM (LG_001_01_CLTOTFIL.DEBIT - LG_001_01_CLTOTFIL.CREDIT) AS [Bakiye]
FROM
LG_001_CLCARD WITH (NOLOCK)
LEFT OUTER JOIN LG_001_01_CLTOTFIL
WITH (NOLOCK) ON LG_001_CLCARD.LOGICALREF = LG_001_01_CLTOTFIL.CARDREF AND (LG_001_01_CLTOTFIL.TOTTYP=1)
GROUP BY
LG_001_CLCARD.DEFINITION_,
LG_001_CLCARD.CODE,
LG_001_01_CLTOTFIL.MONTH_,
LG_001_01_CLTOTFIL.DEBIT,
LG_001_01_CLTOTFIL.CREDIT
HAVING (LG_001_01_CLTOTFIL.MONTH_=1
OR LG_001_01_CLTOTFIL.MONTH_=2
OR LG_001_01_CLTOTFIL.MONTH_=3
OR LG_001_01_CLTOTFIL.MONTH_=4
OR LG_001_01_CLTOTFIL.MONTH_=5
OR LG_001_01_CLTOTFIL.MONTH_=6
OR LG_001_01_CLTOTFIL.MONTH_=7
OR LG_001_01_CLTOTFIL.MONTH_=8
OR LG_001_01_CLTOTFIL.MONTH_=9
OR LG_001_01_CLTOTFIL.MONTH_=10
OR LG_001_01_CLTOTFIL.MONTH_=11
OR LG_001_01_CLTOTFIL.MONTH_=12)
ORDER BY [AY] DESC