Shippwreck
Programmer
Hi,
I'm trying to write an update query but its not working as i want it to... i'll explain!
Table1:
ID, Day1, Day2, Day3, Day4, Day5, Day6, Day7
Table2:
Date, ID, Unit, SellingPrice
Table1 contains unique ID's and then price data for the past 7 days. Table2 contains actual dates in the format 22/10/2007 the same unique ID's as Table1 and prices in the form 5.96 I ignore units, they mean nothing at the moment
I get a new Table2 each week covering the last week, so if there were 100 ID's it would have 100 lines for each day, ie 700 lines.
I want to write a query that updates the prices between the two, Day1 being the oldest day in the week. I'm happy to update 1 day at a time and run teh query 7 times in a VBA loop or do all at once. The query i have written below attempts one day at a time:
UPDATE [4_week_prices], [Vol_Price_Input]
SET [4_week_prices].[Day1] = [Vol_Price_Input].[SellingPrice]
WHERE [4_week_prices].[ID]=[Vol_Price_Input].[ID]
AND [Vol_Price_Input].[sellingprice]=#10/22/2007#;
Thanks for any help you can give!
Matt
"Google is god...of the internet" - Me
I'm trying to write an update query but its not working as i want it to... i'll explain!
Table1:
ID, Day1, Day2, Day3, Day4, Day5, Day6, Day7
Table2:
Date, ID, Unit, SellingPrice
Table1 contains unique ID's and then price data for the past 7 days. Table2 contains actual dates in the format 22/10/2007 the same unique ID's as Table1 and prices in the form 5.96 I ignore units, they mean nothing at the moment
I get a new Table2 each week covering the last week, so if there were 100 ID's it would have 100 lines for each day, ie 700 lines.
I want to write a query that updates the prices between the two, Day1 being the oldest day in the week. I'm happy to update 1 day at a time and run teh query 7 times in a VBA loop or do all at once. The query i have written below attempts one day at a time:
UPDATE [4_week_prices], [Vol_Price_Input]
SET [4_week_prices].[Day1] = [Vol_Price_Input].[SellingPrice]
WHERE [4_week_prices].[ID]=[Vol_Price_Input].[ID]
AND [Vol_Price_Input].[sellingprice]=#10/22/2007#;
Thanks for any help you can give!
Matt
"Google is god...of the internet" - Me