title: Writing case statement based on BETWEEN operator in sql server
body: <p>I have a <code>CASE</code> statement, which looks like below:</p>
  
  <pre><code>SELECT CASE 
  WHEN &lt;expression&gt;&gt; BETWEEN 0 AND 10 THEN '0-10'
  WHEN &lt;&lt;expression&gt;&gt; BETWEEN 11 AND 20 THEN '11-20'
  WHEN &lt;&lt;expression&gt;&gt; BETWEEN 21 AND 30 THEN '21-30'
  ...
  </code></pre>
  
  <p>This works great but it looks ugly.</p>
  
  <p>I want to convert it to something which looks like below:</p>
  
  <pre><code>SELECT CASE &lt;expression&gt;&gt;
  WHEN  BETWEEN 0 AND 10 THEN '0-10'
  WHEN  BETWEEN 11 AND 20 THEN '11-20'
  WHEN  BETWEEN 21 AND 30 THEN '21-30'
  ...
  </code></pre>
  
  <p>Obviously the second query looks better as I dont have to write that complex expression multiple times. But it is error-ing out. </p>
  
  <pre><code>Incorrect syntax near the keyword 'between'.
  </code></pre>
  
  <p>Can someone please let me know what I am doing wrong here?</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>As pointed out, I have changed the query in my question to make the ranges exclusive.</p>