title: MYSQL SELECT records older than 1 year ago
body: <p>I try to get a list of all records that are older than 1year ago from my database, the field for expired_contract has next information.</p>
  
  <pre><code>expired_contract DATE NOT NULL
  </code></pre>
  
  <p>So it takes the DATE in the next format: YEAR-MM-DD, next i have the sql that i cant get it working sadly.</p>
  
  <pre><code>$sql = "SELECT * 
          FROM My_Contracte 
          WHERE expired_contract &gt;= DATE_SUB(NOW(),INTERVAL 1 YEAR) 
          ORDER BY id_contract DESC";
  </code></pre>
  
  <p>I tried a lot of "WHERE" commands but none worked as i expected. Can you help me get this working? I'm looking on this for about 5hours i need exact command to get it worked.</p>
  
  <p>The $sql gets me something but takes it wrong, i get dates like: 2015-10-01, 2016-10-01 and date like 2014-09-30 doesn't show up.</p>
  
  <p>Basically i want to show dates like:</p>
  
  <p>If today is 2015-10-01 i want to see dates older than 1year ago so from 2014-09-30 and not showing dates like 2015-10-01, 2016-10-01.</p>
  
  <p>Maybe do i have to edit something in database?</p>
  
  <p>Looking for your help, thank you!</p>