title: SQL Syntax error using BETWEEN
body: <p>I have a table named ticket. I am trying to query between two dates, however; I keep getting a syntax error. Any help would appreciated as to what this syntax error may be.</p>
  
  <pre><code>SELECT date 
  FROM ticket 
  WHERE date BETWEEN YEAR(ticket.date)=2011 AND MONTH(ticket.date)=11 AND DAY(ticket.date)=06
                  AND YEAR(ticket.date)=2011 AND MONTH(ticket.date)=11 AND DAY(ticket.date)=12
  </code></pre>
  
  <p>You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '=2011 AND MONTH(ticket.date)=11 AND DAY(ticket.date)=06 AND YEAR(ticket.date)=20' at line 1</p>