Arkadaşlar aşağıdaki tabloyu oluşturmaya çalışıyorum. Ve ekteki sorguyu yazabildim. Ama birtürlü ilerleyemedim. Sql ve logo bilenlerden doğru sorgu konusunda yardımlarınızı bekliyorum.
Tşk.
Cari unvanFATURA TARİHİ FATURA VADESİ VADESİ GEÇEN GEÇEN GÜN
TUTAR
Cari a 01.01.2006 01.01.2006
Cari b 09.01.2006 09.01.2006 1.500 -28
Cari c 09.01.2006 09.01.2006 1.985 -28
Cari a 19.01.2006 19.01.2006 1.799 -18
Cari b 07.01.2006 07.01.2006 1.433 -30
Cari c 07.01.2006 07.01.2006 1.844 -30
Cari a 16.01.2006 26.01.2006 382 -11
* CARİ HESAP BAZINDA VADESİ GEÇMİŞ ALACAKLARIN GECİKME GÜNÜ VE TUTARI
sorgu:
SELECT FICHENO,CLCARD.DEFINITION_,PROCDATE 'FATURA TARİHİ',DISCDUEDATE VADE
,SUM(INVOICE.NETTOTAL)'FATURA TOPLAM TUTAR(YTL)',PAYTRANS.PAID'ÖDENEN TUTAR',SUM(INTERESTAPP)'KAPANAN TUTAR'
FROM LG_005_01_PAYTRANS PAYTRANS ,LG_005_CLCARD CLCARD ,LG_005_01_INVOICE INVOICE
WHERE CLCARD.LOGICALREF=PAYTRANS.CARDREF AND CROSSREF<>0 AND PAYTRANS.SIGN=0 AND INVOICE.CLIENTREF=CLCARD.LOGICALREF
AND CLIENTREF IN (SELECT LOGICALREF FROM LG_005_CLCARD WHERE SUBSTRING (CODE,1,2)='1.')
GROUP BY DISCDUEDATE,PROCDATE ,INVOICE.NETTOTAL,PAYTRANS.PAID,CLCARD.DEFINITION_,INTERESTAPP,FICHENO
ORDER BY INTERESTAPP DESC
Tşk.
Cari unvanFATURA TARİHİ FATURA VADESİ VADESİ GEÇEN GEÇEN GÜN
TUTAR
Cari a 01.01.2006 01.01.2006
Cari b 09.01.2006 09.01.2006 1.500 -28
Cari c 09.01.2006 09.01.2006 1.985 -28
Cari a 19.01.2006 19.01.2006 1.799 -18
Cari b 07.01.2006 07.01.2006 1.433 -30
Cari c 07.01.2006 07.01.2006 1.844 -30
Cari a 16.01.2006 26.01.2006 382 -11
* CARİ HESAP BAZINDA VADESİ GEÇMİŞ ALACAKLARIN GECİKME GÜNÜ VE TUTARI
sorgu:
SELECT FICHENO,CLCARD.DEFINITION_,PROCDATE 'FATURA TARİHİ',DISCDUEDATE VADE
,SUM(INVOICE.NETTOTAL)'FATURA TOPLAM TUTAR(YTL)',PAYTRANS.PAID'ÖDENEN TUTAR',SUM(INTERESTAPP)'KAPANAN TUTAR'
FROM LG_005_01_PAYTRANS PAYTRANS ,LG_005_CLCARD CLCARD ,LG_005_01_INVOICE INVOICE
WHERE CLCARD.LOGICALREF=PAYTRANS.CARDREF AND CROSSREF<>0 AND PAYTRANS.SIGN=0 AND INVOICE.CLIENTREF=CLCARD.LOGICALREF
AND CLIENTREF IN (SELECT LOGICALREF FROM LG_005_CLCARD WHERE SUBSTRING (CODE,1,2)='1.')
GROUP BY DISCDUEDATE,PROCDATE ,INVOICE.NETTOTAL,PAYTRANS.PAID,CLCARD.DEFINITION_,INTERESTAPP,FICHENO
ORDER BY INTERESTAPP DESC