Marchese Il Chihuahua
Marchese Il Chihuahua

Reputation: 1129

Run time error 3075 syntax error on update query

i am having an issue with writing an update query in SQL where there are two clauses one of which has two scenerarios identified with an AND function.

The run time error i am getting is 3075 stating there is syntax errors on the where expression. Loooking at it and after doing a lot of research, i imagine i am almost there.

Thanks, A

st_sql = "UPDATE tblSearchEngine01 SET tblSearchEngine01.Query01OpenItems =""" & _
    "WHERE (((tblSearchEngine01.Status)='open')) OR (((tblSearchEngine01.Overall_status)    <>'complete') AND ((tblSearchEngine01.Status) Is Null))"

Upvotes: 0

Views: 533

Answers (1)

Lorenz Meyer
Lorenz Meyer

Reputation: 19895

Well, the error is not where you suspect. Two quotes inside a quoted string are interpreted as one quote. You need to double your quotes here :

 st_sql = "UPDATE tblSearchEngine01 SET tblSearchEngine01.Query01OpenItems =""""" & _

Consider using single quotes for SQL statements, as this will improve readability.

 st_sql = "UPDATE tblSearchEngine01 SET tblSearchEngine01.Query01OpenItems = ''" & _

Upvotes: 1

Related Questions