Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 getting the name of a month

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2004-11-01 : 08:37:55
Luke Niesink writes "dear sqlteam
i was wondering if there was a way to get the name of a month.
I have date object, but when i use ´month(dateobject)´ it will give me, for instance, ´11´. I would like to get ´November´
I don´t know if this is possible, or if i should just make another table, containing a column ´number´ and ´name´ with all the combinations (1, januari) (2, februari) in it.
thank you."

robvolk
Most Valuable Yak

15732 Posts

Posted - 2004-11-01 : 08:36:01
Use the DateName() function:

SELECT DateName(month, getdate())

You can get other date names besides month. See Books Online for more details.
Go to Top of Page
   

- Advertisement -