Now here we can have a glimpse of pure beauty. About half as many lines as the original code (counting the single SELECT statement as several lines), and much easier to follow.
>Hi Hilmar,
>
>You're correct. I forgot that processing was for multiple dates.
SELECT date, SUM(dr_amount) AS debit, SUM(cr_amount) AS credit ;
> FROM vouchers ;
> WHERE acc_code = m.acc_code1 AND date <= m.t_date1 ;
> GROUP BY date ;
> INTO CURSOR crsSums
>
>SELECT cash_f
>APPEND FROM ( DBF("crsSums") )
>
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)