Quick way to convert no''s to month names

  • Hello Gurus,

    Is there a function or sp to convert numbers (1-12) into month names, ie 1 - January, 2 -February, 12 - December etc ?

    thanks in advance for your help

     

  • Select DATENAME(M, GetDate())

  • Sorry, the number is an integer, not a date.

    I have a column which has month no's in it, I want to convert them to corresponding month names.

     

  • --For example:

    DECLARE @month_num int

    SET @month_num = 3

    SELECT Datename( month, DATEADD( month, @month_num-1, 0 ) )

     

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply