title: mySQL Selecting between two DATETIME
body: <p>I am using python and mysql connector and am trying to get all eventids from the mySQL DB between two different datetime stamps.</p>
  
  <p>The DB is</p>
  
  <pre><code> eventid | date | homeodds | drawodds | awayodds 
  </code></pre>
  
  <p>This is the code:</p>
  
  <pre><code>def findarbs(startdate, enddate):
  cnx = mysql.connector.connect(**dbconfig)
  cur = cnx.cursor()
  command = "SELECT DISTINCT eventid, date FROM moneyline 
                 WHERE 'date' &gt; ('%s') AND 'date' &lt; ('%s') 
                 ORDER BY date asc" % (startdate, enddate)
  print command
  cur.execute(command)
  result = cur.fetchone()
  print result
  while result is not None:
      print result[1]
      result = cur.fetchone()
  </code></pre>
  
  <p>And the call to the method:</p>
  
  <pre><code>findarbs("2015-03-01 15:00:38", "2015-03-08 15:00:38")
  </code></pre>
  
  <p>Now if I change the command to:</p>
  
  <pre><code>command = "SELECT DISTINCT eventid, date FROM moneyline 
                 WHERE 'date' &gt; ('%s') 
                 ORDER BY date asc" % (startdate)
  </code></pre>
  
  <p>it sucessfully selects the correct eventids and dates. If I change it to less than it also works. But when I try to combine them or use the BETWEEN command I get NONE back.</p>