title: How to query date in mySQL with string data type
body: <p>I am trying to get data from mySQL table within two dates. The data type of "date" column is string.  My mySQL query is </p>
  
  <pre><code>SELECT * FROM `accounts` WHERE date between STR_TO_DATE('01/03/2017', '%d/%m/%Y') and STR_TO_DATE('20/03/2017', '%d/%m/%Y')
  </code></pre>
  
  <p>It shows nothing. if I write, </p>
  
  <pre><code>SELECT * FROM `accounts` WHERE date between '01/03/2017'  and '20/03/2017'
  </code></pre>
  
  <p>it takes almost all data. Here is the screen shot.</p>
  
  <p><a href="https://i.stack.imgur.com/hvHNC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hvHNC.png" alt="Screen"></a></p>