Leemi
Wed Oct 12 11:01:56 CDT 2005
Hi PatrickHO:
Use the ALTER TABLE command to add a numeric field to the table. Then use
a write a loop (you can use a SCAN...ENDSCAN) to skip through the records
and sum the values of the first field.
Finally, use a REPLACE command to insert the total in the appropriate
record within the loop.
I hope this helps.
This posting is provided "AS IS" with no warranties, and confers no rights.
Sincerely,
Microsoft FoxPro Technical Support
Lee Mitchell
*-- VFP9 HAS ARRIVED!! --*
Read about all the new features of VFP9 here:
http://msdn.microsoft.com/vfoxpro/
*--Purchase VFP 9.0 here:
http://www.microsoft.com/PRODUCTS/info/product.aspx?view=22&pcid=54787e64-52
69-4500-8bf2-3f06689f4ab3&type=ovr
Keep an eye on the product lifecycle for Visual FoxPro here:
http://support.microsoft.com/gp/lifeselectindex
- VFP5 Mainstream Support retired June 30th, 2003
- VFP6 Mainstream Support retired Sept. 30th, 2003
>Dear all,
>Here's a table:
>a
>----
>1
>2
>3
>4
>5
>i would like to add a column b, and write a program so that the following
>result can be drawn:
>a b
>--- ---
>1 1
>2 3
>3 6
>4 10
>5 15
>you see, the field b is the cumulative sum of a.
>How can i perform this by foxpro program, i am using foxpro 8 >