title: Athena / Presto query with date doesn't work with variable
body: <p>Base query without variable works - however while trying to use variable I am running into issue</p>
  <p><strong>Works:</strong></p>
  <pre class="lang-sql prettyprint-override"><code>myquery = &quot;SELECT * FROM  x where range between '2021-08-08' and '2021-08-09'
  </code></pre>
  <p>Attempt 1:</p>
  <pre class="lang-py prettyprint-override"><code>start_date = '2021-08-08'
  end_date = '2021-08-09'
          
  myquery = &quot;SELECT * FROM  x where range between date '{start_date}' and date '{end_date}'
  myquery =  myquery.format(start_date = start_date, end_date = end_date)
          
  Error - Cannot check if varchar is BETWEEN date and date'
  </code></pre>
  <p>Attempt 2:</p>
  <pre class="lang-py prettyprint-override"><code>myquery = &quot;SELECT * FROM  x where range between date ({start_date}) and date ({end_date})
  myquery =  myquery.format(start_date = start_date, end_date = end_date)
          
  Error- Unexpected parameters (integer) for function date. Expected: date(varchar(x)) , date(timestamp) , date(timestamp with time zone)
  </code></pre>
  <p>Attempt 3:</p>
  <pre class="lang-py prettyprint-override"><code>myquery = &quot;SELECT * FROM  x where range between CAST ({start_date} AS DATE) and CAST({end_date} AS DATE)
  myquery =  myquery.format(start_date = start_date, end_date = end_date)
  
  Error : Cannot cast integer to date'
  </code></pre>
  <p>Attempt 4:</p>
  <pre class="lang-py prettyprint-override"><code>myquery = &quot;SELECT * FROM  x where range between {start_date} and {end_date}
  myquery =  myquery.format(start_date = start_date, end_date = end_date)
  
  Error: Cannot check if varchar is BETWEEN integer and integer'
  </code></pre>
  <p>Any insights into what I need to modify - all SO search around this points to above attempts.</p>