title: Records with Publication date greater than today and less than the expiration date
body: <p>I want all records that are within the allowed dates.</p>
  
  <pre><code>SELECT
    page_id, page_published_date, page_expired 
  FROM 
    pages
  WHERE
    ([page_published_date] &amp;lt;= getdate() OR [page_published_date] is null)
    AND
    ([csp_expired] &amp;lt;= getdate() OR [page_expired] is null)
  </code></pre>
  
  <p>Mind that dates can contain null values.</p>
  
  <p>Example table:</p>
  
  <pre><code>page_id, page_published_date, page_expired
  1        2012-10-05           null
  2        null                 2012-10-01
  3        2012-08-01           2012-11-30
  </code></pre>
  
  <p>In this case the correct record would be 3.</p>