title: MySQL BETWEEN and ">= AND <=" giving different results
body: <p>Is there any difference between MySQL BETWEEN operator and using ">= &lt;="?</p>
  
  <p>When i tried them on this query, they give different results.</p>
  
  <pre><code>SELECT 
        tblStaff.TitleGredCd,
        count(StudCourse1.StaffNoIC),     
        StudCourse1.StaffNoIC,
        StaffNm,
        BranchNm, 
        StDt, 
        EndDt, 
        SUM(datediff(EndDt,StDt)+1)  
        TotalDay, 
        (SELECT SUM( pembelajaranhour ) 
           FROM tblpembelajaran d 
           WHERE d.StaffNoIC = tblStaff.StaffNoIC
             AND YEAR( PembelajaranDate ) = 2011 )Totalhour,
        (SELECT SUM( datediff( kendiridate, kendiridate ) +1 ) 
           FROM tblkendiri d 
           WHERE d.StaffNoIC = tblStaff.StaffNoIC 
             AND YEAR( kendiridate ) = 2011 ) Totalkendiriday
     FROM 
        StudCourse1, 
        tblStaff 
           LEFT OUTER JOIN tblRefBranch 
              ON tblStaff.BranchCd = tblRefBranch.BranchCd, 
        tblRefTitleGred
     WHERE 
            StudCourse1.StaffNoIC = tblStaff.StaffNoIC 
        AND tblStaff.TitleGredCd = tblRefTitleGred.TitleGredCd 
       [Date Condition]
     GROUP BY 
        tblStaff.TitleGredCd, 
        StudCourse1.StaffNoIC
  </code></pre>
  
  <p>If I use <code>AND StDt BETWEEN '2011-1-1' AND '2011-12-31'</code> for <code>[Date Condition]</code> I get 6 returned results.
  But if I use <code>AND StDt &gt;= '2011-1-1' AND EndDt '2011-12-31'</code> for <code>[Date Condition]</code> I get 7 returned results.
  Any advice would be greatly appreciated.</p>