1
votes

I have very simple query that is not working and I get error:

'Syntax Error (missing operator) in query expression Tabela2.SALES2 FROM Tabela2'

Here is the code:

UPDATE Tabela1 
SET Tabela1.SALES = Tabela2.SALES2 
FROM Tabela2 
WHERE Tabela1.ID = Tabela2.ID

I want to run this query from VBA/Excel on Acces database (2007). Others queries with e.g. SELECT are working fine, so the problem is only with the query. And I really don't know why it is not working.

4
is the double quote at the end where line part of the original query? - Luis LL
see this - user2140173
No, there is no quote. It's only mistake in above code. - hakubaa

4 Answers

4
votes

An UPDATE query using FROM is possible in SQL Server, but not in MS Access. Use this instead:

UPDATE Tabela1 INNER JOIN Tabela2 ON Tabela1.ID = Tabela2.ID 
SET Tabela1.Sales = [Tabela2].[Sales2];
0
votes

UPDATE Tabela1 SET Tabela1.SALES = Tabela2.SALES2 FROM Tabela1,Tabela2 WHERE Tabela1.ID = Tabela2.ID

0
votes

try this

UPDATE Tabela1 
SET Tabela1.SALES = Tabela2.SALES2 
FROM Tabela1 
INNER JOIN Tabela2 
WHERE Tabela1.ID = Tabela2.ID
-1
votes
Update TABLE2, TABLE1
SET TABLE2.SALES2 = TABLE1.SALES
WHERE TABLE2.ID=TABLE1.ID

hey friends try this 100% working. As per poonam FROM statement is not possible and its true but no need to inner join and make your query slow down.
This SQL Query will run on MS Access only.