title: How to specify null date in a query for MYSQL?
body: <p>I have to check a condition on date whether a datecolumn of a table is in range of another two sets of date from other table..</p>
  
  <p>First Table : </p>
  
  <pre><code>1. id
  2. name
  3. date
  </code></pre>
  
  <p>Second table ;</p>
  
  <pre><code>1. id
  .
  .
  .
  .
  17 : Start Date
  18 : End Date
  </code></pre>
  
  <p>I have to check whether the <code>date</code> field of first table is in range of <code>Start Date</code> and <code>End Date</code> of second table.</p>
  
  <p>e.g. </p>
  
  <pre><code>t1.date&gt;= t2.Start Date and t1.date &lt;= t2.End Date
  </code></pre>
  
  <p>Problem is that, there are some row where <code>t2</code> is null..
  if it is <code>null</code>, then second condition return <code>true</code>.</p>
  
  <p><strong>First Case</strong></p>
  
  <pre><code> t1.date = 26-Nov-2011
   t2.Start Date = 25-Nov-2011
   t2.End Date  = 27-Nov-2012
   *Passed*
  </code></pre>
  
  <p><strong>SECOND Case</strong></p>
  
  <pre><code> t1.date = 26-Nov-2011
   t2.Start Date = 25-Nov-2011
   t2.End Date  = 25-Nov-2011
  
    *FAILED*
  </code></pre>
  
  <p><strong>THIRD CASE</strong></p>
  
  <pre><code> t1.date = 26-Nov-2011
   t2.Start Date = 27-Nov-2011
   t2.End Date  = 27-Nov-2011
  
    *FAILED*
  </code></pre>
  
  <p><strong>FOURTH CASE</strong></p>
  
  <pre><code> t1.date = 26-Nov-2011
   t2.Start Date = 25-Nov-2011
   t2.End Date  = null
  
    *Passed*
  </code></pre>
  
  <p>Please help.</p>