Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can not get the correct Grand Total
Message
From
13/04/1998 03:08:14
 
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00091431
Message ID:
00091451
Views:
26
>The following data is the result of SQL from two tables (customer table and payment table) where each customer can have partial payments. e.g: John has a credit limit of 100 and he's paid three times (5, 10 and 30). I want the Grand Total to show only the actual total of credit limit of each customer (John=100, Marry=300, Tony = 300) which comes to 700. But the total on the summary band always shows 1200. How can I get the sum of 700 of 3 customers' credit limits ?
>
>Yes, I got your problem.
>
>>> Use Variables option at Report Pad Menu. Declare 2 variables:
>
> 1. VarGrp for group counter
> Value to Store Expr : VarGrp + 1
> Reset at : Group Name (Field Group Name)
>
> 2. VarTotal for summary total
> Value to Store Expr: IIF(VarGrp = 1, VarTotal+CredLimit, VarTotal)
> Reset at: End of Report
>
>>> Place VarTotal at Summary Portion of Report form.
>
>I hope this helps,
>
>
>JESS

Jess, I want to thank you for your help. It works fine. Would you please tell me how VFP treats the VarTotal's expression (the IIF() statement) ?

Thanks a lot and best regards,
Andi Hidajat
pkshq@cbn.net.id
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform