select (YEAR(t2)-YEAR(t1))*12+(MONTH(t2)-MONTH(t1))+(case when DAY(t2)-DAY(t1)<0 then -1 else 0 end) from tab
select (YEAR(t2)-YEAR(t1))*12+(MONTH(t2)-MONTH(t1))+(case when DAY(t2)-DAY(t1)<0 then -1 else 0 end) from tab