Update query using data in same query

G

Guest

I have a table with three fields: Hour, Tank, Volume
I want to create a query that, when run, will take the volume of a group of
tanks, and change it to the corrosponding tanks of a different time.
For example:

Hour Tank Vol
1:00 1 100
1:00 2 200
1:00 3 300
2:00 1 150
2:00 2 250
2:00 3 350

Query Results (Change 1:00 Volumes to 2:00 Volumes)

Hour Tank Vol
1:00 1 150
1:00 2 250
1:00 3 350
2:00 1 150
2:00 2 250
2:00 3 350
 
G

Guest

I used a datatype of DateTime for the Hour field. Try this ---
UPDATE RMires INNER JOIN RMires AS RMires_1 ON RMires.Tank = RMires_1.Tank
SET RMires.Volume = [RMires_1].[Volume]
WHERE (((RMires.Hour)=#12/30/1899 1:0:0#) AND ((RMires_1.Hour)=#12/30/1899
2:0:0#));
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top