I am trying to use an update query to update the first 3 characters of a string. but i am getting a syntax error
my query is
update table1, table 2 set left(table1.stringfield, 3) = table2.stringfield
thankstksy
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
OK, there’s a couple of things
Firstly, your set statement should look something like this
This will take the first 3 chars from table2.stringfield, and the chars from 4 onwards in table1.stringfield.
This will run into problems if table1.stringfield is less than 4 characters long, you might want something like
Secondly, you need to join the two tables together, I don’t have MSAccess handy at the moment, the easiest way to do this is to put a straight forward update query together with the designer, and then look at the SQL view for that query.
Hope this helps 🙂