1

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.

3
  • is the double quote at the end where line part of the original query? Commented Aug 12, 2013 at 8:20
  • see this Commented Aug 12, 2013 at 8:20
  • No, there is no quote. It's only mistake in above code. Commented Aug 12, 2013 at 8:32

4 Answers 4

4

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];
Sign up to request clarification or add additional context in comments.

3 Comments

Thanks, It's working fine:) but mayby you know also way the query with FROM is not? Is it sth with Access ?
Query using "from" is not possible in access.But it's possible in sql.
@user2674174 If your question has been answered, please mark the answer that you feel best addressed your question as accepted. You can also upvote the accepted answer and any other answers you found useful.
0

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

1 Comment

Thanks, but it dosen't help.
0

try this

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

Comments

-1
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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.