Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Removing duplicate Columns in View's SQL
Message
De
24/06/2009 17:43:00
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Removing duplicate Columns in View's SQL
Divers
Thread ID:
01408243
Message ID:
01408243
Vues:
86
I've created a view to use for a report based on a Parent - Child - Grandchild arragement. I'm able to retreive the correct resultset.

I need to count each parent's children and sum certain field values that also belong to each parent's children. In some cases, a parent's child may have more than one child (grandchild) and that's were I'm having difficulty. When a child has more than one child(grandchild), the resultset contains more than the actual number of children as follows:

Parent1 - Child1 - Grandchild1
Parent1 - Child1 - Grandchild2

In the above case there is actually only one parent and only one child, but, because the child has two children(grandkids), it causes "duplicate" parents and children.

The report prints correctly. The "duplicate" parents and children do not print, but both the count and sum vars double their results. For example in the above case, the Child1 count ends up being 2 instead of 1 and the summed values that should be 0.05 are 0.10. I'd appreciate any and all ideas on how to resolve this issue.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform