• Function MonthNamex(@mm numeric (2))

    as

    select case when @mm not between 1 and 12 then 'Invalid Month' else datename(mm,str(@mm)+'/04/2011') end