title: Selecting rows with dates before a given date using pandasql
body: <p>I have this data frame, where id is an <code>int64</code>, and date is <code>datetime64[ns]</code>:</p>
  <pre><code>         id                        date
  0   1811302  2017-03-08 00:00:00.000000
  1     16095  2013-03-12 00:00:00.000000
  2     16095  2017-09-15 00:00:00.000000
  ..      ...                         ...
  74  1111806  2017-09-15 00:00:00.000000
  75   482254  2013-01-01 00:00:00.000000
  76   482254  2015-12-16 00:00:00.000000
  </code></pre>
  <p>In reality, my data frame has more than a million number of rows.</p>
  <p>Now, using pandasql, how do I extract rows before a given date, say before 2017-09-11?</p>
  <p>I tried:</p>
  <pre><code>sqlcode = 'SELECT id, date from df where strftime(&quot;%Y-%m-%d&quot;, date) &lt; {}'.format(&quot;2017-09-11&quot;)
  ps.sqldf(sqlcode,locals())
  </code></pre>
  <p>Which returns nothing:</p>
  <pre><code>Empty DataFrame
  Columns: [id, date]
  Index: []
  </code></pre>
  <p>Any suggestions?</p>