title: How to SET DATEFIRST equal to Sunday in Amazon Redshift
body: <p>2016-01-01 is the week 1 of 2016, but also is the week 53 of 2015.</p>
  
  <p>When I run <code>SELECT DATE_PART(w, '2016-01-01')</code> it returns <code>53</code>, but when I run <code>SELECT DATE_PART(w, '2016-01-04')</code> it returns <code>1</code>.</p>
  
  <p>Most probably this is happening because Redshift sets Monday as the day 1 of the week, and not Sunday, as it should be.</p>
  
  <p>Not sure if this will solve the problem, but what I need is to make 2016-01-01 as week 1 and from 2016-01-03 to 2016-01-09 as week 2 and so on...</p>