title: SQL query to retrieve results based on date and time
body: <p>I have the following tables with data:</p>
  
  <p>customer:   </p>
  
  <pre><code>cus_id             cus_name
  1                  philip
  2                  david
  3                  morris
  </code></pre>
  
  <p>order:              </p>
  
  <pre><code> order_id   order_no    cus_id  ordr_status      order_ date_time
      1             123        1       d                      20121015 13:10:01
      2             456        1       c                      20121014 14:20:00
      3             789        2       d                      20121013 17:10:01
      4             767        2       c                      20121014 15:10:00
  </code></pre>
  
  <p>Based on this data, I want to retrieve both customer and order information if the order date time is  between 20121014 14:00:00 and 20121015 14:00:00 and if the the order status is  (d,c) and they have same oder id's. </p>