DECLARE @yearFrom SMALLINT,@yearTo SMALLINT,@lenthOfyear SMALLINT
set @lenthOfyear=10
SELECT @yearFrom =year( getdate())set @YearTo = @yearFrom+@lenthOfyear SELECT
CAST(temp.Number + @yearFrom AS CHAR(4)) as [Year]FROM(SELECT Number
FROM master..spt_values
WHERE Type = 'P'AND Number <= @YearTo - @YearFrom) AS temp
No comments:
Post a Comment