title: ColdFusion query four days ago
body: <p>I want to query order information from 4 days ago. I cannot quite get the query to use the full 24hours of the day though:</p>
  
  <pre><code>&lt;cfquery name="rsByDate" datasource="#request.dsn#"&gt;
      SELECT tbl_customers.cst_FirstName
              , tbl_customers.cst_LastName
              , tbl_customers.cst_Email
              , tbl_orders.order_ID
              , tbl_orders.order_Date
      FROM  tbl_customers INNER JOIN tbl_orders 
                 ON tbl_customers.cst_ID = tbl_orders.order_CustomerID
      WHERE tbl_orders.order_Date &gt;= #CreateODBCDateTime(DateAdd("d",-5,Now()))#
      AND   tbl_orders.order_Date &lt;= #CreateODBCDateTime(DateAdd("d",-4,Now()))#
      AND   order_Status = 3
      ORDER BY tbl_orders.order_Date DESC
  &lt;/cfquery&gt;
  </code></pre>
  
  <p>What I'm hoping to achieve is to perform this query and then use <code>cfmail</code> to ask the customers to review us four days after their order is marked as status 3 'shipped'.</p>
  
  <p>I think I have the date settings not quite right. Where am I going wrong?</p>