title: Get closest date to current date sql
body: <p>i know that may question is a duplicate of <a href="https://stackoverflow.com/questions/16398661/sql-find-date-closest-to-current-date">this</a> but when i tried the answers they provide i got a different answer... </p>
  
  <p>so i have a table and today is <code>06/02/2017</code>
  <strong>tblpres</strong></p>
  
  <pre><code>patID     pres       presDate
    1     |    asd     |    05/29/2017
    2     |    qwe     |    05/20/2017
    3     |    zxc     |    06/01/2017
    4     |    ety     |    05/27/2017
    5     |    ttt     |    05/18/2017
  </code></pre>
  
  <p>so i made a query to get the closest date to the current date but instead i get id 3 whch is the closest date to the current date i get a diff answer..</p>
  
  <pre><code>SELECT pres,presDate
  FROM tblpres
  WHERE patID = '20150518384'
  ORDER BY presDate DESC
  LIMIT 1
  
  SELECT pres, presDate
  FROM tblpres
  WHERE patID = '20150518384'
  ORDER BY ABS( DATEDIFF(presDate, `06/02/2017` ) )
  LIMIT 1
  
  SELECT pres, presDate
  from tblpres
  WHERE patID = '20150518384'
  order by abs('06/02/2017' - presDate) desc
  limit 1
  
  SELECT pres,presDate
  FROM tblpres
  WHERE `patID` = '20150518384' AND presDate &lt; '06/02/2017'
  ORDER BY presDate
  LIMIT 1
  </code></pre>
  
  <p>this is the query i tried but nothing seems to work... i do get an answer for this query but the result is not what i expected..</p>