Hey guys,
I've got the following SQL:
But when I run this, Access prompts me for the values of I.item_shelfstock - Q.pre_allocated_stock, I assume from the first line.
I realise this is probably because I and Q aren't defined until later in the query, but I'm unsure how to swap the layout round....
I've got the following SQL:
Code:
PARAMETERS orderno Text ( 255 );
UPDATE tblOrder_Item SET item_qty = I.item_shelfstock - Q.pre_allocated_stock
WHERE orderitem_id IN
(
SELECT Q.orderitem_id FROM qryOrder_Item AS Q INNER JOIN tblItem AS I ON Q.item_id=I.item_id
WHERE
(I.item_shelfstock - Q.pre_allocated_stock) < Q.item_qty
AND
(I.item_shelfstock - Q.pre_allocated_stock) >= 0
AND Q.order_id=[orderno] );
But when I run this, Access prompts me for the values of I.item_shelfstock - Q.pre_allocated_stock, I assume from the first line.
I realise this is probably because I and Q aren't defined until later in the query, but I'm unsure how to swap the layout round....