title: Increment database values using "update" and "join" together in a SQL query
body: <p>My code isn't working. I've tried a few different thing but am not sure where to go from here. I'm adding to values that begin from null in the following query. After I run my code, the score values are still null. </p>
  
  <p>The Answers database and the WeeklyPredictions database both have several attributes for additional questions in them. This is just a snippit of code using the first Question 1.</p>
  
  <pre><code>    var Q1 = "";
      var weeknumber = "";
  
      if (IsPost)
      {
          if (Request.Form["weeknumber"] != null)
          {
              weeknumber = Request.Form["weeknumber"];
          }
          if (Request.Form["Question1"] != null)
          {
              string selectedAnswer = Request.Form["Question1"].ToString();
              Q1 = Request.Form["Question1"];
          }
  
  
          var db = Database.Open("foo");
  
          var q1w = ("UPDATE t1 " +
              "SET t1.weeklyScore = t1.weeklyScore + 10, t1.totalScore = t1.totalScore + 10 " +
              "FROM dbo.Scores as t1 " +
              "INNER JOIN dbo.WeeklyPredictions AS t2 " +
              "ON t1.Id = t2.Id " +
              "WHERE t2.Question1 = @0 " +
              "AND t2.WeekNumber = @1");
  
  db.Execute(q1w, Q1, weeknumber);
  </code></pre>