UPDATE with INNER JOIN

Tarebare30

New member
Local time
Today, 11:26
Joined
Apr 26, 2013
Messages
2
Hi
I'm trying to update field TT_Zone from table Allocations with the values in field TT_Zone from table AllZones. I have written this query:

UPDATE Allocations
SET Allocations.TT_Zone = AllZones.TT_Zone
FROM Allocations
INNER JOIN AllZones
ON Allocations.Building_Name = AllZones.Building_Name
WHERE Allocations.Building_Name = AllZones.Building_Name;

but when I run, I get a 'Sytax error (missing operator) in query expression' message.

I'm very new to this, so I'm sure it's something stupid but hoping someone can help? I've looked at lots of examples online and can't see where I'm going wrong.

Thanks in advance.
 
Hello Tarebare30, Welcome to AWF.. :)

Remove the WHERE part of the Query and see what happens..
 
Actually .. thank you to anyone who was going to help but I finally got it! I was making my life too complicated. For anyone else who is looking for a similar answer, the following worked:

UPDATE Allocations
INNER JOIN AllZones
ON Allocations.Building_Name = AllZones.Building_Name
SET Allocations.TT_Zone = AllZones.TT_Zone;
 

Users who are viewing this thread

Back
Top Bottom