phroureo
phroureo

Reputation: 379

Simple SQL Server issue with formatting dates

I'm trying to get a month from a date returned as a full month name. For example, I'm using

SELECT FORMAT(MONTH(GETDATE()),xxxxxx) 

I don't know what to make xxxxxx in order to get it to return as "November".

Is this even possible, or is it something that I can't get it to do?

EDIT: Never mind. I noticed that the error I'm getting doesn't even reference the xxxxxx part. It tells me "FORMAT" is not a regonized built-in function name.

Upvotes: 0

Views: 24

Answers (1)

Vamsi Prabhala
Vamsi Prabhala

Reputation: 49260

You can use DATENAME.

SELECT datename(month, GETDATE()) 

Upvotes: 3

Related Questions