title: How to use between operator with case statement in SQL Server 2005
body: <p>How to use <code>BETWEEN</code> operator with <code>CASE</code> statement</p>
  
  <pre><code>@FromEmpAge
  @ToempAge
  
  select * from Emp
  where EmpAge between
    case when ToempAge0 then @FromEmpAge and @ToempAge end
  </code></pre>
  
  <p>How to do this?</p>