title: MySql select 1 week & 1 Month advance date from Current date
body: <p>i want to get the list of date which is going to expire in a week or a month...
  MySQL, and field is TIMESTAMP.</p>
  
  <p>i tried below queries...</p>
  
  <blockquote>
    <p>SELECT CERT_ID, date(CERTVALIDITY) 
        FROM mst_CERT WHERE date(CERTVALIDITY) > now() - interval 1 week ORDER BY CERTVALIDITY;</p>
  </blockquote>
  
  <p>This returns all the dates from current date</p>
  
  <blockquote>
    <p>SELECT date(CERTVALIDITY) from mst_CERT where curdate() =
    DATE(DATE_SUB(CERTVALIDITY, INTERVAL 1 week));</p>
  </blockquote>
  
  <p>returns nothing...</p>
  
  <blockquote>
    <p>SELECT date(DATE_SUB(CERTVALIDITY, INTERVAL 1 MONTH)) from mst_CERT;</p>
  </blockquote>
  
  <p>returns nothing...</p>
  
  <pre><code>| CT00078      | 2020-02-28  |
  | CT00098      | 2020-02-29  |
  | CT00011      | 2020-03-31  |
  | CT00012      | 2020-03-31  |
  | CT00013      | 2020-03-31  |
  | CT00014      | 2020-03-31  |
  | CT00075      | 2020-03-31  |
  | CT00055      | 2020-03-31  |
  | CT00056      | 2021-03-31  |
  </code></pre>