HollyAnne6
HollyAnne6

Reputation: 93

How to convert date to text Month?

How do I convert the date to a month spelled out?

For example.

01/08/2015 = January

I have it code in excel =TEXT(value, "MMMM") but we are shifting away from Excel to SQL Server.

Thanks

Upvotes: 0

Views: 542

Answers (4)

david sam
david sam

Reputation: 531

select datename(month,convert(varchar,yourField,106)) as month
from yourTable

Upvotes: 0

Emacs User
Emacs User

Reputation: 1475

This is one way:

SELECT DATENAME(month, youDateField)) as Month
FROM YourTable

Upvotes: 0

jhilden
jhilden

Reputation: 12429

SELECT DATENAME(MONTH, GETDATE())

Upvotes: 0

Amit
Amit

Reputation: 46323

You need to use the DATENAME function.

For example:

SELECT DATENAME(mm, DateCol) AS [Month]
FROM MyTable

Upvotes: 1

Related Questions