Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Wrong sum of parent table in report summry
Message
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00520371
Message ID:
00520376
Views:
15
I assume what is happening is that the parent field is being summed for every detail band or record -- which includes one-to-many child records.

What I have done is to create two variables.

nChildCounter -- Count(), which resents each time the parent group changes.

and then :

nParentFieldsum = iif(nchildCounter=1,nParentField,0)

So this only sums the parent field on it's first occurance.

>Hi, every body
>I have two tables in report data environment. The relationship between them is a field named section and the same field is data group. All the calculations are ok expect the sum of parent table's fields in summry. When I interchange parent to child and child to parent it always give worng sum of parent table's fields only in summary band. I tried using variables and by changing data grouping but still the problem is same. When I use single table report it gives all the sum correct. The problem is due to two tables and the child table has all the calculation ok. All the calculations are ok even in group footer. Only in report summary parent table fields give wrong sum.
>
>Anyone may help?
>
>Thanks
>
>zaheer
Previous
Reply
Map
View

Click here to load this message in the networking platform