Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Combining Child Recs into a Flat File for Export
Message
De
17/12/1997 17:43:51
David Byrd
Baker, Byrd & Associates, Inc.
Austin, Texas, États-Unis
 
 
À
17/12/1997 14:03:10
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00066645
Message ID:
00066752
Vues:
29
>>Problem:
>>Two tables: one parent , one child. The relationship is one-to-many.
>>
>>(In reality I have 10+ tables to perform this operation on, but two tables will suffice for an example of the problem).
>>
>>I need a flat file to do a mail merge with Microsoft Word. Suppose the parent table has the name of a mother and father, and the child table has the names of their children.
>>
>>PARENT.Mother = "Jane Doe"
>>PARENT.Father = "John Doe"
>>
>> CHILD.Name = "Mark"
>> CHILD.Name = "Sally"
>> CHILD.Name = "Jessica"
>>
>>I need a record like this: Mother, Father, Name1, Name2, Name3
>>
>>I achieved this result while playing with SQL in the command window (FoxPro 2.6) several years ago by accident. And I have absolutely no clue how to reproduce it.
>>
>>David
>
>David,
> If there is a key link between Mother and Father AND each child is linked to one or both parents try this:
>
> Select Parent.Mother,
> Parent.Father,;
> Child,Name ;
> FROM Parent,Child ;
> WHERE Parent.Key = Child.key
>
>Thanx!
>
>Tony Miller
>Vancouver, Wa

Thanks for the reply Tony,

The SQL above gives me:

Jane Doe, John Doe, Mark
Jane Doe, John Doe, Sally
Jane Doe, John Doe, Jessica

Thanks,
David
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform