title: SQL GROUP BY week (Monday 07:00:00 to Monday 06:59:59)
body: <p>I've created a query that groups production data on ISO week by using this query</p>
  
  <pre><code>SELECT to_char(wid_date,'IYYY'), to_char(wid_date,'IW'), tonnes
  FROM production
  WHERE to_char(wid_date,'IYYY') = '2009' 
  GROUP BY to_char(wid_date,'IYYY'), to_char(wid_date,'IW')
  </code></pre>
  
  <p>The problem is that our "production weeks" don't follow the ISO standard. They run from Monday morning at 07:00:00 to Monday morning at 06:59:59.</p>
  
  <p>Any suggestions on how I can get it to report using our production weeks?</p>
  
  <p>Thanks kindly, </p>
  
  <p>Tommy</p>