select ao.*, ph.invDate,sum(pl.shipped) as shipped ; from allOrders ao ; left join pastinvoiceLines pl ; on (pl.itemNum = ao.item_num) ; LEFT join pastinvoices ph ; on (ph.invnum = pl.invnum) ; AND ph.poNum = ao.po_num ; group by poItem ; into cursor merged>Hello all,
>select oh.po_num, oh.request_d, ol.item_num, ol.prod_id1, ol.qty_order, ; > ol.price, (oh.po_num + ol.item_num) as poItem ; > from order_h oh ; > join order_l ol on (oh.order_num = ol.order_num) ; > where oh.request_d >= {^2001-11-01} ; > and oh.request_d <= {^2001-02-28} ; > and cust_num = " 116" ; > into cursor allOrders && returns 5444 records >>
>select ao.*, ph.invDate,sum(pl.shipped) as shipped ; > from allOrders ao ; > left join pastinvoiceLines pl ; > on (pl.itemNum = ao.item_num) ; > join pastinvoices ph ; > on (ph.invnum = pl.invnum) ; > where ; > ph.poNum = ao.po_num ; > group by poItem ; > into cursor merged >>