title: How can I include null values in BETWEEN clause?
body: <p>In my query's <code>where</code> clause I have the condition:</p>
  
  <pre><code>User.DateOfBirth BETWEEN @startDate AND @endDate 
  </code></pre>
  
  <p>Where <code>@startDate</code> and <code>@endDate</code> are nullable. If  <code>@startDate</code> is null, I want all values less than or equal to <code>@endDate</code>; if <code>@endDate</code> is null, I want all values greater than or equal to <code>@startDate</code>; if both are null I want all values.</p>
  
  <p>My failed attempt - returns 0 results</p>
  
  <pre><code>((( User.DateOfBirth &gt; @startDate) OR (@startDate Is null)) AND  (( User.DateOfBirth &lt; @endDate) OR (@endDate is null)) )
  </code></pre>
  
  <p>(Editor's note: <code>BETWEEN</code> includes the end points (less/greater than <em>or equal</em>), but the description for the null cases didn't. I've assumed this is an oversight.</p>