Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Progressbar
Message
 
 
To
13/05/2005 22:35:20
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Environment versions
Visual FoxPro:
VFP 6
OS:
Windows '98
Network:
Windows 98
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01014147
Message ID:
01014155
Views:
19
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") )
>>It's much simpler to do with a query
SELECT date, SUM(dr_amount) AS debit, SUM(cr_amount) AS credit ;
>>	FROM vouchers ;
>>	WHERE acc_code = m.acc_code1 AND  date = m.fdate1 ;
>>	INTO CURSOR crsSums
>>
>>SELECT 	cash_f
>>APPEND FROM ( DBF("crsSums") )
>>
>
>Since this is repeated for several dates, I would also apply a GROUP BY DateField to avoid the loop.
>
>(I gave an example with GROUP BY, but still used a SCAN loop. Adding an APPEND FROM makes this unnecessary.)
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform