title: SQL select current week/last week
body: <p>I'm looking for a way of selecting rows based on:</p>
  
  <ul>
  <li>Current week (S-S)</li>
  <li>Previous week (S-S)</li>
  </ul>
  
  <p>The problem I'm having is selecting specifically from <strong>Sunday-Sunday</strong>.</p>
  
  <p>At the moment I'm using:</p>
  
  <pre><code>SELECT SUM(time) 
  FROM `time` 
  WHERE `projectid` = '$pid' &amp;&amp; created &gt; DATE_SUB(NOW(), INTERVAL 1 WEEK)
  </code></pre>
  
  <p>Any help would be great, thanks!</p>