By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,739 Members | 1,506 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,739 IT Pros & Developers. It's quick & easy.

Converting a date field to the month

P: n/a
How can I create a field in a view that takes a date field and
converts it to a month?
For instance, if I have a field called "CreatedOn" with a date of
'2/22/2007', how can I create another field called "Month" that will
say "February"? Is there a built-in SQL function that does this (like
using CONVERT) or do I need to write my own?

Thanks!
Lisa

Mar 30 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
(li**********@gmail.com) writes:
How can I create a field in a view that takes a date field and
converts it to a month?
For instance, if I have a field called "CreatedOn" with a date of
'2/22/2007', how can I create another field called "Month" that will
say "February"? Is there a built-in SQL function that does this (like
using CONVERT) or do I need to write my own?
Look up datename in Books Online.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Mar 30 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.