declare @year int,@month int
while (@month <=13 and @year<=year(getdate()))
SET @year=case @month when 13 then @year +1
ans @month =1 else @year end
in this case statemtent i also want that when year increase means when increment of year happens then month variable shouls chage oe reset to 1 so that loop can start from 1 month of new year..
but i get error in this case statement when i use and @month =1
please help me and provide needful step
View Complete Post