Hi
Im looking to update about 80 rows in a table where I need to sum some values from the source table.
Basically I want to run a query that does this:
UPDATE tblDaily
SET SALES = x, REDEMPTIONS = y, NET = (x + y)
WHERE FDATE > 13-Feb-2006
AND FDATE < 14-Jun-2006
The values of x and y are stored in another table, and I can get them using this query:
SELECT SUM(x), SUM, SUM(x + y)
FROM tblSTAGING
WHERE FDATE > 13-Feb-2006
AND FDATE < 14-Jun-2006
What Im looking to do is to combine these queries so that I can run the UPDATE query with the SELECT query as a sub-query.
Does anyone know how to do this?
Thanks in advance!
Im looking to update about 80 rows in a table where I need to sum some values from the source table.
Basically I want to run a query that does this:
UPDATE tblDaily
SET SALES = x, REDEMPTIONS = y, NET = (x + y)
WHERE FDATE > 13-Feb-2006
AND FDATE < 14-Jun-2006
The values of x and y are stored in another table, and I can get them using this query:
SELECT SUM(x), SUM, SUM(x + y)
FROM tblSTAGING
WHERE FDATE > 13-Feb-2006
AND FDATE < 14-Jun-2006
What Im looking to do is to combine these queries so that I can run the UPDATE query with the SELECT query as a sub-query.
Does anyone know how to do this?
Thanks in advance!