Hi to all,
i created following table
-------------------------------------

create table employee(name varchar(20), dob datetime)
-------------------------------------

I want to extract names of all months from 'dob'. for that i wrote following query
-------------------------------------
select datepart(month, dob) from employee
--------------------------------------
it works and shows all months but in number format,
i want to display all months in character format. i.e. january, february, march, ...
How can I do it?

Thanks & regards,
Pooja.

SELECT DATENAME(month, dob) AS 'Month Name' from employee

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.