title: issue with sql query to fetch records before 1 month from current date
body: <p>I am using MySQLi and I have SQL structure like <a href="https://www.screencast.com/t/kzpetDoSO" rel="nofollow noreferrer">This</a> and I want all records which have expired date before 1 month </p>
  
  <p>for that, I have tried</p>
  
  <pre><code>SELECT
      *
  FROM
      new_domain
  WHERE
      DATEPART( m, expire_date ) = DATEPART( m, DATEADD( m, -1, getdate() ) )
      AND
      DATEPART( yyyy, expire_date ) = DATEPART( yyyy, DATEADD( m, -1, getdate() ) )
  </code></pre>
  
  <p>but with that, I have receive an error <code>#1305 - FUNCTION DATEPART does not exist</code></p>
  
  <p>can anybody help me with this</p>