title: SQL statement: SET DATEFIRST 5
body: <p>I have a statement like this that would not work on SQL Azure/Spotfire. I wanted to make the timestamp start from Friday-Thursday while the FirstDayOfweek pulls in once every week.</p>
  <p>errors message
  External error:</p>
  <blockquote>
  <p>Parse error at line: 1, column: 16: Incorrect syntax near 'SET'.</p>
  </blockquote>
  <pre class="lang-sql prettyprint-override"><code>SET DATEFIRST 5;
  SELECT DATEADD(wk, 0, DATEADD(DAY, 1-DATEPART(WEEKDAY, Daily.Timestamp), DATEDIFF(dd, 0, Daily.Timestamp))) as 'FirstDayOfWeek'
  </code></pre>