title: Compare datetime in peewee sql Python
body: <p>Apparently, I could not compare the date in the peewee SQL. </p>
  
  <pre><code>START_DATE = datetime.datetime(2015, 7, 20, 0, 0, 0)    
  customer_records = Customers.select().\
                      join(Current_Insurers, on=(Customers.current_insurer == Current_Insurers.id)).\
                      switch(Current_Insurers).\
                      join(Insurers, on=(Current_Insurers.insurer == Insurers.id)).\
                      where(Customers.pol_type == "PC" &amp; \
                            Current_Insurers.effective_date ==  START_DATE )
  </code></pre>
  
  <p>Where <code>Customers</code>, <code>Current_Insurers</code>, <code>Insurers</code> are three <code>class</code>. The result is always 0 records. But if I removed the <code>datetime</code> condition from the sql and compare as follows</p>
  
  <pre><code> customer_records = Customers.select().\
                          join(Current_Insurers, on=(Customers.current_insurer == Current_Insurers.id)).\
                          switch(Current_Insurers).\
                          join(Insurers, on=(Current_Insurers.insurer == Insurers.id)).\
                          where(Customers.pol_type == "PC" 
  for r in customer_records:
      if(r.current_insurer.effective_date == START_DATE):
          print(r.policy_id)
  </code></pre>
  
  <p>Surprisingly we can compare now and print out customers. </p>
  
  <p>What do I need to do to add the <code>datetime</code> condition in the <code>peewee</code> <code>sql</code>?</p>
  
  <p>Many thanks,</p>