What is wrong with this UPDATE SQL ?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I get a syntax error on this, can I not do a SET .. = SELECT?:


UPDATE tblRuleQA SET Response = SELECT Q.DefaultResponse FROM
tblRuleQuestions As Q, tblRuleQA As R
WHERE Q.ID = R.QuestionID
AND R.Response IS NULL
AND Q.DefaultResponse IS NOT NULL

Is there another way to do it? Thanks.
 
Try this
==============================================
UPDATE tblRuleQA inner join tblRuleQuestions On tblRuleQuestions.ID =
tblRuleQA.QuestionID
SET tblRuleQA.Response = tblRuleQuestions.DefaultResponse
WHERE tblRuleQA.Response IS NULL
AND tblRuleQuestions.DefaultResponse IS NOT NULL
 

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

Back
Top