declare @year int
declare @months int
set @months=36
set @year=@months/12
print @year
In the above case, @year is an integer, so even if you pass 45 as month, you will get 3 as output.
So it will be like
0-11 out put is 0
12-23 output is 1
24-35 output is 2
36-47 output is 3
Updated solution
declare @year int
declare @months int
set @months=45
set @year=@months/12
set @months=@months%12
print cast(@year as varchar(100))+' years '+cast(@months as varchar(100))+ ' months '
this wil give me
3 years 9 months