p0welly Posted January 29, 2007 Share Posted January 29, 2007 in a table i have a date of birth column sored in a date field in the default mysql format of 2006-12-18 I want to sort the list by month (for sending out birthday cards) so the year is not important. Any suggestions? Link to comment Share on other sites More sharing options...
0 Starchild Posted January 30, 2007 Share Posted January 30, 2007 I'm no professional, but try: SELECT DATE_FORMAT(date_col, '%M') as month FROM table ORDER BY month See this for more information. Link to comment Share on other sites More sharing options...
0 p0welly Posted February 21, 2007 Author Share Posted February 21, 2007 Ah cheers mate, Sorry for the delayed response I forgot all about this! Link to comment Share on other sites More sharing options...
0 XerXis Posted February 21, 2007 Share Posted February 21, 2007 easier would be SELECT ... FROM table ORDER BY MONTH(date_col) Link to comment Share on other sites More sharing options...
0 Starchild Posted February 21, 2007 Share Posted February 21, 2007 easier would beSELECT ... FROM table ORDER BY MONTH(date_col) Agreed :yes: Link to comment Share on other sites More sharing options...
Question
p0welly
in a table i have a date of birth column sored in a date field in the default mysql format of 2006-12-18 I want to sort the list by month (for sending out birthday cards) so the year is not important.
Any suggestions?
Link to comment
Share on other sites
4 answers to this question
Recommended Posts