473,395 Members | 1,622 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Want to get monthname from a date

I am using SQL Server and want to extract the month name (e.g. January, February, March etc) from a date. I am going to be plotting the data in a chart and need the data in month order not alphabetical order. It doesn't look like the
datepart() function will do this. Can the SQL date function be used in SQL Server? I'm trying to avoid having the x axis of my graph have values like:
1, 2, 3, 4, 5, etc for the months and would prefer the month names instead (expressed in their correct month order).
Sep 11 '06 #1
2 72879
MrByte
4
How about using

DATENAME(month, '5/1/06')

It will return the Month Name, May in the above sample


I am using SQL Server and want to extract the month name (e.g. January, February, March etc) from a date. I am going to be plotting the data in a chart and need the data in month order not alphabetical order. It doesn't look like the
datepart() function will do this. Can the SQL date function be used in SQL Server? I'm trying to avoid having the x axis of my graph have values like:
1, 2, 3, 4, 5, etc for the months and would prefer the month names instead (expressed in their correct month order).
Sep 11 '06 #2
yanto
1
Thanks to MrByte

I try your solution and its running well
see my script test http://sqltosql.blogspot.com/2012/08...onth-name.html
Aug 31 '12 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Janet Chapman | last post by:
I am creating a database for a video shop and in the loans table want there to be a field for date taken, with a default value of today. Trying to write =today() as in the help gives an error,...
1
by: Paul Evans | last post by:
Hi, I have created a datagrid which works just fine. One of the columns retrieves the date which particular row was populated. However, the format which the date is returned is: 19.12.2004...
10
by: sandraz444 | last post by:
I have an expression in the query under my form to autofill the date under a certain condition but it wont write to the underlying table?? The date shows in the form but not the table. Does anyone...
3
by: Pavkovich | last post by:
I have tried to set a date field when I put a checkmark in a yes/no field. In the date fields control source I put the following: IIf(=0," ",Date()) Unfortunately using Date() simply changes the...
4
by: Orchid | last post by:
How can I change a Date datatype to a Number datatype? For example, I want a date 10/31/2006 to show 1031 as Number datatype. But I don't want it becomes 39021. What formula should I use? ...
10
by: meltedown | last post by:
If I have an sql date, such as "2006-11-19" is there a way using either sql or php date and time functions to get the date of the the first day of the month ?
21
by: Darin | last post by:
I have an applicatoin that works 100% perfect when running on a machine setup for English (United States), but when I change it to Spanish (Mexico), the dates start giving me fits. THe reason is...
2
by: Brad Pears | last post by:
I am working on a vb.net 2005 project using sql server 2000 as the backend . I am having a bit of problems with date variables... Here is the scenario... I have a table that includes a couple...
16
by: Nathan Sokalski | last post by:
I have a control uses the date and time, including milliseconds. I want to be able to enter this information as an attribute in the *.aspx page. Because all attributes are entered as strings in the...
1
by: zolamdlankomo | last post by:
(SMALLDATETIME,GETDATE(),20) ...i want the date to be 2010-02-02. wen i run the statement above it gives mt todays dat bt i want 2010-02-02
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.