error in query

B

Bart

Dear all,

I have this query to update some values in Access, but I receive an error of
Syntax.
I'm quite sure the syntax is ok.......

strSql = "UPDATE [S1] SET (S1.[Parent ID]=(-1)) FROM ([Structure] AS [S1]
LEFT JOIN [Structure] AS [S2]) ON (S1.[Parent ID]=S2.[ID]) WHERE S2.[Parent
ID]=(-1) AND S1.[Parent ID]<>0"
where is the error?

thank you,

Bart
 
M

Michel Walsh

Hi,


UPDATE tableName SET fieldName=SingleValue



It seems you miss the field name to be updated. Also, if the single value
come from a another table, write the JOIN between the UDPATE and SET:

UPDATE table1 INNER JOIN table2 ON ... SET
table1.fieldName=table2.otherFieldName WHERE ...



Hoping it may help,
Vanderghast, Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top