Try this
DECLARE @FrmDate date = '31dec2009'
,@EndDate date = '01jan2010'
SELECT
CASE WHEN DATEpart(MM,@FrmDate)=DATEpart(MM,@EndDate)
THEN CASE WHEN DATEpart(DD,@FrmDate)>DATEpart(DD,@EndDate)
THEN datediff(MM,@FrmDate,@EndDate)/12 - 1
ELSE datediff(MM,@FrmDate,@EndDate)/12
END
ELSE datediff(MM,@FrmDate,@EndDate)/12
END