the top fo0rm shows the items that need purchasing the second form shows me the situation with stock etc and what allocation but not allocated . when the first line for that part is allocated and i tick the box it will disapear from the form. as you can see there are 2 transactions for that part f which i only want the second on to show up in my purchase order form and the first transaction could have been for order a week ago but has not been allocated yet so it it showing history
how can i get it to tell me the outstanding qty is 89 and not show me the 86
thanks steve
how can i get it to tell me the outstanding qty is 89 and not show me the 86
thanks steve
Code:
INSERT INTO [supplier orders] ( [stock number], material, costs, type, unit, [Qty required], balance, [qty outstandng] )
SELECT [Order Details order suppliers3].StockNumber, [Order Details order suppliers3].Material, [Order Details order suppliers3].Cost, [Order Details order suppliers3].Type, [Order Details order suppliers3].Unit, [Order Details order suppliers3].ReqQty1, [Order Details order suppliers3].BALANCE, IIf([balance] Is Null,Sum([reqqty1]),Sum([reqqty1]-[balance])) AS outstandingqty
FROM [Order Details order suppliers3]
GROUP BY [Order Details order suppliers3].StockNumber, [Order Details order suppliers3].Material, [Order Details order suppliers3].Cost, [Order Details order suppliers3].Type, [Order Details order suppliers3].Unit, [Order Details order suppliers3].ReqQty1, [Order Details order suppliers3].BALANCE, [Order Details order suppliers3].qtyoutstanding, Now()+91
HAVING ((([Order Details order suppliers3].Type)<>"capacitor"))
ORDER BY [Order Details order suppliers3].StockNumber, [Order Details order suppliers3].Type;