title: pyodbc: ORACLE SQL Statement with WHERE Clause that incorporates date range
body: <p>I am using pyodbc to extract data from a database table. Now, <strong>I would like to limit the query to only contain the records that were added within the last 24 hrs.</strong> The information about the time a record was added is contained in the <code>DATE_ADDED</code> column . </p>
  
  <p>This is what I am trying:</p>
  
  <pre><code>pyodbc.pooling = False
  conn_str = (
      r'DRIVER={Oracle in OraClient12Home1};'
     .....
     .....
     .....)
  
  conn = pyodbc.connect(conn_str)
  curs = conn.cursor()
  
  
  date_today = datetime.datetime.today()
  date_yesterday = date_today - datetime.timedelta(days=1)
  
  sql = f"SELECT PROD_ID, ID, COUNT, DATE_ADDED FROM LZE.APODAT WHERE DATE_ADDED &lt; {date_today} AND DATE_ADDED  &gt; {date_yesterday}"
  
  my_df = pd.DataFrame(pd.read_sql(sql, conn))
  
  </code></pre>
  
  <p>The error message I get is: </p>
  
  <blockquote>
    <p>UnicodeDecodeError: 'utf-16-le' codec can't decode bytes in position
    218-219: illegal encoding</p>
  </blockquote>
  
  <p>I'm sure it has to do with the different formatting/data types of the <code>DATE_ADDED</code> column but I am unsure how to approach this. In the database it looks as follows: <code>2019-04-24 10:21:05 AM</code></p>
  
  <p>Any help would be greatly appreciated. </p>