title: how to select sum of column based on date
body: <p>I have the following table in a database. I want to be able to get the sum of the value colum but only based on the date. so if today was january 1st i only want the sum for every value that has jan 1st as the date. I am using the following: </p>
  
  <pre><code>SELECT SUM(value) AS value_today FROM table_value GROUP BY date ORDER BY date DESC
  </code></pre>
  
  <p>Only problem is that it only returns the sum for december 22 and nothing new entered into the database.</p>
  
  <pre><code>+-------+---------+------------+
  | ID    | value   | date       |
  +-------+---------+------------+
  |   1   |   3     | 2011-12-22 |
  |   2   |   2     | 2011-12-22 |
  |   3   |   4     | 2011-12-22 |
  |   4   |   2     | 2012-01-01 |
  +-------+---------+------------+
  </code></pre>