thebatfink
Registered User.
- Local time
- Today, 08:57
- Joined
- Oct 2, 2008
- Messages
- 33
Hi I am trying to update fields with a value from another table.
I have two tables -
Products
Settings
Each table has the following field which I will use as the matching key, but there are no relationships set on these tables -
RefNo
So for exmaple, basically I want
[Products].[ProductTemp] field to = [Settings].[SettingTemp] where [Products].[RefNo] = [Settings].[RefNo]
I got this from googling around and it won't work.. I assume because we are involving the second table. But I'm sure there must be a way to do this, but I'm not knowledgable enough to achieve it.
So any help would be greatly appreciated
Thanks!
I have two tables -
Products
Settings
Each table has the following field which I will use as the matching key, but there are no relationships set on these tables -
RefNo
So for exmaple, basically I want
[Products].[ProductTemp] field to = [Settings].[SettingTemp] where [Products].[RefNo] = [Settings].[RefNo]
I got this from googling around and it won't work.. I assume because we are involving the second table. But I'm sure there must be a way to do this, but I'm not knowledgable enough to achieve it.
Code:
UPDATE [Products]
SET [ProductTemp] = [Settings].[SettingTemp]
FROM [Products], [Settings]
WHERE [Products].[RefNo] = [Settings].[RefNo]
;
So any help would be greatly appreciated
Thanks!