Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Columns total
Message
From
21/03/2006 09:08:16
 
 
To
21/03/2006 08:58:09
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 8 SP1
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01106199
Message ID:
01106202
Views:
15
>Hi
>If I have cursor with few fields (The columns names and count is not permanent but data type always is integer).
>The first column name is permanent.
>I want to add column to total the values in all columns for each line without the first column (second column and onward).
>Help plesae

Chaim

Not sure if you mean add an extra column that holds the total of all the other cols in each rec:
Update SubjTable add column COLTOT
Select SubjTable
Locate
Scan
  lnColTot   = 0
  LnColCount = FCOUNT()
  For lnCol = 2 to lnColCount-1
    lcCol    = FIELD( lnCol)
    lnColTot = lnColTot +  &lcCol
  EndFor
  Update SubjTable set COLTOT = lnColTot
EndScan
HTH

Terry
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform