SELECT CLCARD.CODE AS KODU, CLCARD.DEFINITION_ AS UNVAN,
(SUM((1 – CLFLINE.SIGN) * CLFLINE.AMOUNT) – SUM(CLFLINE.SIGN * CLFLINE.AMOUNT)) AS [BAKIYE] FROM
LG_215_01_CLFLINE CLFLINE INNER JOIN
LG_215_CLCARD CLCARD ON CLFLINE.CLIENTREF = CLCARD.LOGICALREF AND CLFLINE.CANCELLED = 0
GROUP BY CLCARD.CODE, CLCARD.DEFINITION_, CLCARD.ACTIVE
HAVING (CLCARD.CODE LIKE ‘%’) and (CLCARD.DEFINITION_ LIKE ‘%’)
AND (CLCARD.ACTIVE = 0) ORDER BY CLCARD.CODE DESC
LG_215_CLCARD CLCARD ON CLFLINE.CLIENTREF = CLCARD.LOGICALREF AND CLFLINE.CANCELLED = 0
GROUP BY CLCARD.CODE, CLCARD.DEFINITION_, CLCARD.ACTIVE
HAVING (CLCARD.CODE LIKE ‘%’) and (CLCARD.DEFINITION_ LIKE ‘%’)
AND (CLCARD.ACTIVE = 0) ORDER BY CLCARD.CODE DESC
0 yorum:
Yorum Gönder