Access SQL query to SELECT from one table and INSERT into another

Posted by typoknig on Stack Overflow See other posts from Stack Overflow or by typoknig
Published on 2011-01-12T02:27:32Z Indexed on 2011/01/12 2:53 UTC
Read the original article Hit count: 179

Filed under:
|
|

Below is my query. Access does not like it, giving me the error Syntax error (missing operator) in query expression 'answer WHERE question = 1'.

Hopefully you can see what I am trying to do. Please pay particular attention to 3rd, 4th, and 5th lines under the SELECT statement.

INSERT INTO Table2 (respondent,1,2,3-1,3-2,3-3,4,5)
SELECT respondent,
answer WHERE question = 1,
answer WHERE question = 2,
answer WHERE answer = 'text 1' AND question = 3,
answer WHERE answer = 'text 2' AND question = 3,
answer WHERE answer = 'text 3' AND question = 3,
answer WHERE question = 4,
longanswer WHERE question 5 FROM Table1 GROUP BY respondent;

© Stack Overflow or respective owner

Related posts about sql

Related posts about sql-server