title: How to use .format() string in a MySQL statement?
body: <p>I'm trying to format a MySQL statement with today's data, as well as 7 days back. I'm pretty sure the date is in the correct format, so I don't think that's the issue.</p>
  <p>The error report is:</p>
  <pre><code> Warning: (1292, &quot;Incorrect datetime value: '{} 16:00:00' for column 'run_start_date' at row 1&quot;)
        result = self._query(query)
      Traceback (most recent call last):
           AttributeError: 'int' object has no attribute 'format'
  </code></pre>
  <p>e.g.</p>
  <pre><code>today = DT.date.today()
  week_ago = today - DT.timedelta(days=7)
  print(today.strftime('%Y-%m-%d'))
  print(week_ago.strftime('%Y-%m-%d'))
  
  cursor.execute(SELECT * FROM db WHERE run_start_date BETWEEN '{} 16:00:00' AND '{} 16:00:00'format(week_ago, today)
  </code></pre>