Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Counting parent records in a 'one to many' relationship.
Message
From
09/11/1999 12:30:05
 
 
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00289027
Message ID:
00289077
Views:
30
In the code example given, you'll have to reselect 'parent' before issuing the set relation command to get this to work.
HTH


>> Example:
>> parent.dbf
>> field1 n(10)
>> child.dbf
>> field1 n(10)
>> field2 c(5)
>>
>> use parent order field1
>> use child in 0 order field1
>>
>> set relation to field1 into child
>> set skip to child
>>
>> DETAIL BAND
>> parent.field1 child.field2
>>
>> SUMMARY BAND
>> [the count of parent.field1]
>> [the count of child.field2]
>>
>> Because of the one to many relationship both totals are always the same.
>> If there is one record in parent for which there is 3 records in child
>> I'm supposed to get:
>>
>> Total of parent: 1
>> Total of child: 3
>>
>>but instead I get
>>
>> Total of parent: 3
>> Total of child: 3
>>
>>The count of parent.field1 increments while the pointer is moved in child.
>>I understand why this is happening, what I don't know is how to fix it.
>>
>>
>>TIA
Previous
Reply
Map
View

Click here to load this message in the networking platform