@angellll:
SWEET! That was quick and easy. Thanks for the resource! 500 points for you! Cheers!
Main Topics
Browse All TopicsHello,
I am trying to create a query that will enable me to print to the screen a list that is ordered by the month stored in the database (January to December). When each database entry is created it logs the date in which the entry was created as yyyy-m-d, and the user defines which Month the entry pertains to.
I am having a problem printing the data to the screen in a fashion that lists the info by Month correctly. When I sort by the Month column in my db, I get a list that is sorted alphabetically (a-z). When I sort by the Date column in my db, I get a list that is sorted according to date but, which recognizes the entry 2009-10-1 as being before 2009-2-1 just simply because it has a number (1) in the first postion of the month.
Is there a way in which I can create a query that will recognize that 2009-10-1 actually comes after 2009-2-1? This would allow me to print my table of information as January, Feb., March.... rather than what you see Jan., Sept., Feb., Mar., etc.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: angelIIIPosted on 2009-11-05 at 13:51:12ID: 25754447
you have to sort by the months value (1-12), and not month name. efman/5.1/ en/date-an d-time- fun ctions.htm l#function _extract
http://dev.mysql.com/doc/r
ORDER BY EXTRACT(MONTH FROM yourfield)