Subject | complex master details |
---|---|
Author | James |
Post date | 2004-08-11T14:48:42Z |
hello
Iam about to make a complex master details relationship, but i dont know
how to do it. Here is the sql of my master dataset
select d.location,
sum(m.qty) qty, sum(m.subtotal)amount, sum(m.qty*d2.net_weight) kilos
from invoice_details m left join invoice d on d.id = m.master_key
left join products d2 on d2.id = m.product_id
where d.status != 'CAN' and d.sales_type = 'OLT' and d.invoice_date =
:invoice_date
group by d.location
and here is the sql of my detail dataset
select d.location,
(select description from products d4 where d4.product_type =
d2.product_type) description,
sum(m.qty) qty
from invoice_details m left join invoice d on d.id = m.master_key
left join products d2 on d2.id = m.product_id
where d.status != 'CAN' and d.sales_type = 'OLT' and d.invoice_date =
:invoice_date and d.location = :location
group by d.location, d2.product_type
I have no idea what shall I put on the masterlinks properties of the
detail dataset or should I use masterparamlinks but how? Can anybody
help me?
Thanks
regards,
james
Iam about to make a complex master details relationship, but i dont know
how to do it. Here is the sql of my master dataset
select d.location,
sum(m.qty) qty, sum(m.subtotal)amount, sum(m.qty*d2.net_weight) kilos
from invoice_details m left join invoice d on d.id = m.master_key
left join products d2 on d2.id = m.product_id
where d.status != 'CAN' and d.sales_type = 'OLT' and d.invoice_date =
:invoice_date
group by d.location
and here is the sql of my detail dataset
select d.location,
(select description from products d4 where d4.product_type =
d2.product_type) description,
sum(m.qty) qty
from invoice_details m left join invoice d on d.id = m.master_key
left join products d2 on d2.id = m.product_id
where d.status != 'CAN' and d.sales_type = 'OLT' and d.invoice_date =
:invoice_date and d.location = :location
group by d.location, d2.product_type
I have no idea what shall I put on the masterlinks properties of the
detail dataset or should I use masterparamlinks but how? Can anybody
help me?
Thanks
regards,
james