UPDATE Query

From: Darren Line (darren_at_ganedatascan.com)
Date: 04/14/04


Date: Wed, 14 Apr 2004 09:55:24 +0100

Hi, I was wondering if you could help me with this query.

I have created the following query...

SELECT Sum(SalesDetailActual.QtyAlloc) AS SumOfQtyAlloc,
SalesDetailActual.ProdRecNo
FROM SalesDetailActual INNER JOIN SalesOrderH ON SalesDetailActual.SoRecNo =
SalesOrderH.SoRecNo
WHERE (((SalesOrderH.SoStatus)<>2) AND ((SalesOrderH.SoType)="S"))
GROUP BY SalesDetailActual.Product
HAVING (((Sum(SalesDetailActual.QtyAlloc))<>0));

The result is just a list of product record numbers and a value next to it.

I would like to use these values to update a field in another table.

The field I would like to update is called "Alloc" in the table "Products"
(ProdRecNo is the key in Products table and also in the query above).

I am just unsure if its possible to actually do this in one command, or I
have to write some vbscript to loop around the query and then do individual
updates per prodrecno.

Any assistance would be much appreciated.

TIA

Darren.