 SELECT H.KODU, H.ACIKLAMA, H.BORC AS HFATURA, H.ALACAK AS HODEME, (SELECT SUM(HI.BORC) FROM HESAPISL AS HI WHERE (HI.KODU=H.KODU) AND (DATEVALUE('28.05.2004')-TARIH>=0)) AS TOPFATURA, (SELECT SUM(HI.ALACAK)  FROM HESAPISL AS HI WHERE (HI.KODU=H.KODU) AND (DATEVALUE('28.05.2004')-TARIH>=0)) AS TOPODEME , (SELECT SUM(HI.BORC-HI.KAPANAN) FROM HESAPISL AS HI WHERE (HI.KODU=H.KODU) AND (DATEVALUE('28.05.2004')-TARIH>= 0) AND (DATEVALUE('28.05.2004')-TARIH<=15)) AS BORC15ALTI, (SELECT SUM(HI.BORC-HI.KAPANAN) FROM HESAPISL AS HI WHERE (HI.KODU=H.KODU) AND (DATEVALUE('28.05.2004')-TARIH>=16) AND (DATEVALUE('28.05.2004')-TARIH<=30)) AS BORC1630, (SELECT SUM(HI.BORC-HI.KAPANAN) FROM HESAPISL AS HI WHERE (HI.KODU=H.KODU) AND (DATEVALUE('28.05.2004')-TARIH>=31) AND (DATEVALUE('28.05.2004')-TARIH<=45)) AS BORC3145, (SELECT SUM(HI.BORC-HI.KAPANAN) FROM HESAPISL AS HI WHERE (HI.KODU=H.KODU) AND (DATEVALUE('28.05.2004')-TARIH>=46) AND (DATEVALUE('28.05.2004')-TARIH<=60)) AS BORC4660, (SELECT SUM(HI.BORC-HI.KAPANAN) FROM HESAPISL AS HI WHERE (HI.KODU=H.KODU) AND (DATEVALUE('28.05.2004')-TARIH>=61) AND (DATEVALUE('28.05.2004')-TARIH<=90)) AS BORC6190, (SELECT SUM(HI.BORC-HI.KAPANAN) FROM HESAPISL AS HI WHERE (HI.KODU=H.KODU) AND (DATEVALUE('28.05.2004')-TARIH>=91)) AS BORC91USTU FROM HESAP AS H WHERE H.KODU LIKE  '120%'  AND ((H.BORC-H.ALACAK)>0) AND H.KODU IN (SELECT DISTINCT HESAPISL.KODU FROM HESAPISL WHERE HESAPISL.KODU LIKE  '120%'  )
 [Elektra                                                                                           ]
                                                                              Tarih       : [GTARIH  ]
                                                                              Saat        :   [BUSAAT]

                             Alıcılar Yaşlandırma Raporu (28.05.2004)

 Kodu        Hesap Adı           Döviz Toplam Fatura    Toplam Ödeme          Bakiye      Borç 0-15      Borç 16-30      Borç 31-45      Borç 46-60      Borç 61-90        Borç 91+
 ----------- ------------------- ----- --------------- --------------- --------------- --------------- --------------- --------------- --------------- --------------- ---------------
{[KODU     ] [ACIKLAMA         ] [DVZ] [~2TOPFATURA  ] [~2TOPODEME   ] [~&04-05      ] [~2BORC15ALTI ] [~2BORC1630   ] [~2BORC3145   ] [~2BORC4660   ] [~2BORC6190   ] [~2BORC91USTU ]}[IHALE]
