I have tested this function...If your requirement is same as i understood then
this function will help you for sure..
Call this function in SP and pass parameter in this function whatever you want..
Parameter Data type must be int...
All of these Which one find your Requirement use that...
SQL Function is below
CREATE FUNCTION [dbo].[Demo1]
(
@MonthNumber int
)
RETURNS varchar(8)
AS
BEGIN
Declare @RDate varchar(max)
Declare @NDate varchar(max)
set @RDate= (@Date)
IF(@Date<> 0)
SET @NDate=SUBSTRING('JAN FEB MAR APR MAY JUN JUL AUG SEP OCT NOV DEC ', (@RDate * 4) - 3, 3)
ELSE
SET @NDate='-'
RETURN @NDate
END
OR You Can also use this way
Select DateName( month , DateAdd( month , @MonthNumber , 0 ) - 1 )
OR
Select DateName( month , DateAdd( month , @MonthNumber , -1 ) )
Thanks
NK___