Consider 3 entities in a grandparent parent child relationship:
House Airway Bill (HAWB) grandparent
Shipments - parent
Charges - child
A HAWB can contain multiple shipments and multiple charges can be posted to a shipment.
What is required is a table by HAWB with the total values of the shipments and the total of the charges.
Can one do this in 1 SQL?
select HAWB, sum(shipment.value), sum(charges.amount);
from Shipment,Charges;
where shipment.shipment= charges.shipment;
order by Hawb;
group by Hawb
gives faulty shipment values. The value gets multiplied by the number of charges for each shipment.
Is this a classic, or worse a faq? In native VFP, you can solve the problem with cascated SQLs, but what if you are in an C/S environment? Just curious.
TIA,
Marc
If things have the tendency to go your way, do not worry. It won't last. Jules Renard.