title: Before/after 15th day of the month
body: <p>I wanted to set the @startdate and @enddate automatically, depending on whether the query is run before or after the 15th day of the month.</p>
  
  <pre><code>select case @startdate when DAY(getdate())&gt;15 -- etc.
  </code></pre>
  
  <p>but it doesn't like the syntax of >15 or =15.  I know DAY() returns an integer (today's result is 25), so I don't know why that won't work. </p>