title: Stored procedure select based on year and month
body: <p>I'm having trouble with my query, I'm trying to display data depending on the year and the month of an input. I'm hallway there it shows the month entered but it brings up data from all the years with that particular month.</p>
  
  <pre><code>         PROCEDURE `date_passed`(in date date)
          BEGIN
          SELECT table1.name, table1.licence, table2.date
          FROM table1
      inner join table2
      on
      table2.table1_idtable1 = table1.idtable1
      where  MONTH (date)= MONTH(date)
      and 
      result='passed'
  </code></pre>