hi there,
i have been trying to create a query that will give me a running total for purchase order quantities. i am using two tables. one which has the item on the purchase order and one table which has the recieve info for that item. each item can be received multiple times thus multiple receiving quantites.
so far the only way to get the total is to store it. and from experience and searching thru some other messages this is NOT the way to go. yet how do i create a query that will keep a running total. DSUM.
YET using Dsum my query gives me the total of ALL the items received in the PurchaseOrder regardless of the item. i would like to have the total PER item
so the output is as follows
Item # Qty Ordered QtyReceived
1 5 5
2 2 2
right now i get 7 for both items!
any help much appreciated, here is what my query looks like:
SELECT tblPurchaseOrders.ItemNum, tblPurchaseOrders.Qty,
DSum("[QtyReceived]","tblReceivedToPO","[PID] IN (Select ID FROM tblPurchaseOrders WHERE PONum = 'SP010604-02')") AS Expr1
FROM tblPurchaseOrders
WHERE (((tblPurchaseOrders.PONum)="SP010604-02"))
GROUP BY tblPurchaseOrders.ItemNum, tblPurchaseOrders.Qty;
the reason for this query is to display it in a listbox on a form.
- Topher
[This message has been edited by Topher (edited 06-04-2001).]
i have been trying to create a query that will give me a running total for purchase order quantities. i am using two tables. one which has the item on the purchase order and one table which has the recieve info for that item. each item can be received multiple times thus multiple receiving quantites.
so far the only way to get the total is to store it. and from experience and searching thru some other messages this is NOT the way to go. yet how do i create a query that will keep a running total. DSUM.
YET using Dsum my query gives me the total of ALL the items received in the PurchaseOrder regardless of the item. i would like to have the total PER item
so the output is as follows
Item # Qty Ordered QtyReceived
1 5 5
2 2 2
right now i get 7 for both items!
any help much appreciated, here is what my query looks like:
SELECT tblPurchaseOrders.ItemNum, tblPurchaseOrders.Qty,
DSum("[QtyReceived]","tblReceivedToPO","[PID] IN (Select ID FROM tblPurchaseOrders WHERE PONum = 'SP010604-02')") AS Expr1
FROM tblPurchaseOrders
WHERE (((tblPurchaseOrders.PONum)="SP010604-02"))
GROUP BY tblPurchaseOrders.ItemNum, tblPurchaseOrders.Qty;
the reason for this query is to display it in a listbox on a form.
- Topher
[This message has been edited by Topher (edited 06-04-2001).]