MONTH in the form on Jan, Feb, ....

  • Dear All,

    I have a query. Is there any function what returns me the char value of month. i mean, i want Jan instead of 1. when i use Month(getdate()) function it returns int value.

    thanks,

    Pramod

  • pramod_yg (11/23/2010)


    Dear All,

    I have a query. Is there any function what returns me the char value of month. i mean, i want Jan instead of 1. when i use Month(getdate()) function it returns int value.

    thanks,

    Pramod

    select DATENAME(MONTH,GETDATE())

    --------------------------------------------------------------------------------------------------
    I am just an another naive wannabe DBA trying to learn SQL Server

  • Thanks Sachin. This one is totally new to me 🙂

  • pramod_yg (11/24/2010)


    Thanks Sachin. This one is totally new to me 🙂

    You are welcome:-).Just incase you need to get weekday names you can replace month with weekday.

    select DATENAME(WEEKDAY,GETDATE())

    --------------------------------------------------------------------------------------------------
    I am just an another naive wannabe DBA trying to learn SQL Server

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

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