title: CASE statement with GETDATE()
body: <p>Wondering if you can help a little with the syntax here. Trying to set a variable as a month value dependent upon whether it is past the 25th day of the month.</p>
  
  <p>If it is, then it uses the current month (e.g. the variable 'month' will be 10 if the date is 28th October, but will be 9 if it's the 24th October). So far I've got the following:</p>
  
  <pre><code>select a
  case
      when (SELECT DAY(GETDATE()) &gt;= 25
      then a = (SELECT MONTH(GETDATE()))
      else a = (SELECT MONTH(GETDATE()) - 1)
  end
  </code></pre>
  
  <p>I understand you can't use less than or greater than signs, as case statements are only for evaluations (=)? Can anyone suggest another way of doing this?</p>
  
  <p>Thanks.</p>