title: T-SQL SUM manually defined values for X columns
body: <p>I'm trying to <code>INSERT</code> a value into a column called <code>Total</code> for a number of hours spent throughout the week.</p>
  
  <p>I have a form on a website that allows a user to input values for Mon, Tues, Weds, Thurs, Fri, Sat &amp; Sun.</p>
  
  <p>I can access the entered values via tokens for each field. IE: if I need the value for Mon, I can grab it using [Mon] and it will pull whatever number the user has entered into the column.</p>
  
  <p>Using this I can build a query such as:</p>
  
  <pre><code>INSERT INTO MyTbl (Mon, Tues, Weds, Thurs, Fri, Sat, Sun,)
  VALUES ('[Mon]', '[Tues]', '[Weds]', '[Thurs]', '[Fri]', '[Sat]', '[Sun]')
  </code></pre>
  
  <p>I'm having trouble modifing this query to <code>SUM</code> all of the day's values as my <code>Total</code> column insert value.</p>
  
  <p>Something like this:</p>
  
  <pre><code>INSERT INTO MyTbl (Mon, Tues, Weds, Thurs, Fri, Sat, Sun, Total)
  VALUES ('[Mon]', '[Tues]', '[Weds]', '[Thurs]', '[Fri]', '[Sat]', '[Sun]',    
          SUM('[Mon]', '[Tues]', '[Weds]', '[Thurs]', '[Fri]', '[Sat]', '[Sun]'))
  </code></pre>
  
  <p>Note that all columns are set to <code>VARCHAR</code> datatype in SQL Server.</p>
  
  <p>Any help or examples appreciated.</p>
  
  <p>IF Data looks like:</p>
  
  <pre><code>Mon, Tues, Weds, Thurs, Fri, Sat, Sun
  1    2     3     4      5    6    7
  </code></pre>
  
  <p>I need a <code>Total</code> field that would sum all day values for in <code>INSERT</code> like:</p>
  
  <pre><code>Mon, Tues, Weds, Thurs, Fri, Sat, Sun, Total
  1    2     3     4      5    6    7    28
  </code></pre>
  
  <p>Basically I need some query that can calculate the <code>Total</code> field in this example a value of <code>28</code> and <code>INSERT</code> that into the <code>Total</code> field in my table.</p>