Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SUM in Grid ( + and - )
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00502733
Message ID:
00502748
Views:
19
This message has been marked as the solution to the initial question of the thread.
>Hi all,
>
>Is there a simply way to do this, i need to sum and to substract the value from one column if the other have 'D' or 'C' i can do that with scan endscan, but if the grid have some records it could be slow. The total is outside the grid. The grid is based in a view.
>
>Thank's
>
>João Batista
>
>Example:
>
>Column1 Column2
>1000.0  D
> 500.0  C
>
>Total - 500.0
>
Do a separate query on your view cursor
sele sum(iif(column2 = 'C',-1 * column1,column1) as sumcolumn1 from yourview to array yourarray
Alek
Alek Massey
- The only stupid question is one left unasked -
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform