Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Wrong
Message
De
30/03/2000 18:31:29
Cindy Winegarden
Duke University Medical Center
Durham, Caroline du Nord, États-Unis
 
 
À
30/03/2000 10:14:50
Christopher Pinnock
United General Insurance Company
Kingston, Jamaique
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Titre:
Re: Wrong
Divers
Thread ID:
00352456
Message ID:
00352990
Vues:
12
Chris,

Why SELECT twice from your data? (Doesn't matter whether VFP or SQL database.)
SELECT Parent.Field1, Parent.Field2, .... Parent.FieldX, ;
    Child.Field1, Child.Field2, .... Child.FieldX ;
    FROM Parent INNER JOIN Child ;
    ON Parent.Pk = Child.Pk ;
    WHERE < some qualifier >
What do you mean that you can't have a qualifier on the parent? Of course you can, unless you are limited by a wizard. Wizards do not allow you to do everything you can do in a prg or through the command window. Consequently, I write my own SQL.

Then to count the parents in your report, you have several options.
On easy way is to:

SELECT COUNT(DISTINCT ReportCursor.ParentPk) ;




>Thanks for your response Cindy.
>
>1. I want a count of the parent table.
>2. I select records from an SQL Server to get my Parent Table
>3. I skip through the parent table and download the children for the record that I'm currently on into a cursor that I created to host all children.
>4. In my report I group by the common key field with no qualifier(eg. cl_claimx).
>5. In the header section of this group I have the fields of the parent table.
>6. In the detail section I have the child Fields.
>7. On the summary bands are my totals. (Hmmm I wonder if the totals shown at the bottom are really correct ??? (All totals are from the parent table.)
>8. The only qualifiers used are the ones on the child table and this is becuase FoxPro wont allow otherwise. (correct me if i'm wrong I've tried it.)
>
>I hope I've explained a little better what I'm talking about. Also This way doesn't offer much room for much grouping and I need to group by other fields in the parent table. I'm really uncertain about how I should approach this problem.
>
>Chris.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform