Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2003
    Location
    Zutphen,Netherlands
    Posts
    256

    Unanswered: Monthname in SQL server

    Being new to SQL server T-SQL (working with DB2 / ORACLE) is there a function like monthname() in SQL server. I.e. a function that takes date as input and returns the Monthname (like AUG or AUGUST)????
    Ties Blom
    Senior Application Developer BI
    Getronics Healthcare
    DB2,ORACLE,Powercenter,BusObj,Access,
    SQL, SQL server

  2. #2
    Join Date
    Jul 2002
    Location
    Village, MD
    Posts
    621
    This example extracts the month name from the date returned by GETDATE.

    SELECT DATENAME(month, getdate()) AS 'Month Name'

    Here is the result set:

    Month Name
    ------------------------------
    February

  3. #3
    Join Date
    Jan 2003
    Location
    Zutphen,Netherlands
    Posts
    256
    Sorry, where can I put the date where I can extract the monthname from?
    I want to add an object that displays 'JAN' or Januari if I have a date like:
    01/01/2003
    Ties Blom
    Senior Application Developer BI
    Getronics Healthcare
    DB2,ORACLE,Powercenter,BusObj,Access,
    SQL, SQL server

  4. #4
    Join Date
    Jul 2002
    Location
    Village, MD
    Posts
    621
    SELECT DATENAME(month, '01/01/2003') AS 'Month Name'

  5. #5
    Join Date
    Jan 2003
    Location
    Zutphen,Netherlands
    Posts
    256
    Thank you very much..................
    Ties Blom
    Senior Application Developer BI
    Getronics Healthcare
    DB2,ORACLE,Powercenter,BusObj,Access,
    SQL, SQL server

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •