>Justok...
>
>Orders (Order_ID, ....)
> |
> /|\
>OrdItems (Order_ID, ITEM, QTY, ....)
> |
> /|\
>Shipment (SHIP_NO, Order_ID, ITEM, SHIPQTY, ....)
>
>-----
>Maybe better would be:
>
>OrdItems(OrdIt_ID, Order_ID, ITEM, QTY)
>
>Shipment(SHIP_NO, OrdIt_ID ...) to tie the shipment(s) to the OrdItems table instead of to Orders. Then each line item has one or more shipments easily tracked.
Ok.. So, can I do SQL sth like:
Creaet SQL VIEW OrdersLeftQTY As ;
Select Orditems.Order_ID, Orditems.ITEM,
Orditems.QTY - SUM(Shipment.SHIPQTY) as LeftQTY... ;
From Orditems Inner Join Shipment On Orditems.OrdIt_ID=Shipment.OrdIt_ID ;
Where OrdItems.Order_ID = ?Thisform.CurOrder_ID ;
Group By Shipment.OrdIt_ID
Then, I'd like to known the different btw :
Select .... ;
Group by Shipment.Order_ID, Shipment.ITEM
and
Select .... ;
Group by Shipment.OrdIT_ID
o_0'
Or Using
SUM, CALCULATE cmd to sum up value and subtract from Orditems.Qty?
The weak wait for chance, The strong bid for chance,
The clever notch up chance, but The merciful give you chance.