Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Display sum of two fields on grid
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00448679
Message ID:
00448708
Views:
8
>>>>>>>>>
Hello all,
I have a grid show a list of record each with two numeric fields, I want to use an additional column to show the sum of that two fields on the fly. how can I do this?

Because I don't want to define that 'sum' field on tabel structure, I have following problems:
-I have try use local view, but local view have no index, so I can't use it to link to parent record.
-I have try the assign method of that tow field to update the sum column display, but it is unreliable that all row's 'sum' column display the current record's 'sum'
-I have try to create a temp table which have that 'sum' field and link to my table. And set the controlsource of column 'sum' to that temp table, but it also doesn't work.

Could you help me?
-Jasper
>>>>>>>>>>>>
Your grid could be based on a cursor with a third field taht is calculated.

SELECT *,(VALUE1+VALUE2) AS TOTAL;
FROM mytable;
INTO CURSOR Query1
Previous
Reply
Map
View

Click here to load this message in the networking platform