.......
WHERE
year(CDATETIME) IN ('2008','2010','2014')
GROUP BY
BOXNUMBER ;
The above query gives more rows because you are not applying any condition on Group by clause and the other query
......
GROUP BY
BOXNUMBER
HAVING
year(CDATETIME) IN ('2008','2010','2014');
here you are applying the condition on group by that what type of records you wanted, as a result u got less records when compared.
have a look at this link which will helps in understanding of sql query execution in detail http://social.msdn.microsoft.com/Forums/sqlserver/en-US/70efeffe-76b9-4b7e-b4a1-ba53f5d21916/order-of-execution-of-sql-queries