#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Location
    Evanston, IL 60202
    Posts
    10
    Rep Power
    0
    I have a date type field in a mySQL table called birthdate that looks like this:
    1950-03-24
    when i do a query and sort by this field, it sorts by year. does anyone know of a way that i can sort my query results by month/day instead of year/month/day.

    Any help would be greatly appreciated.

    Thanks in advance,
    Mike Dill
  2. #2
  3. No Profile Picture
    Apprentice Deity
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 1999
    Location
    Niagara Falls (On the wrong side of the gorge)
    Posts
    3,237
    Rep Power
    18
    select whatever,fields,date_format(birthdate,'%m %d, %Y') as fbday order by fbday;
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Location
    Evanston, IL 60202
    Posts
    10
    Rep Power
    0
    THanks rod! That's exactly what i was looking for!


    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by rod k:
    select whatever,fields,date_format(birthdate,'%m %d, %Y') as fbday order by fbday;[/quote]

Similar Threads

  1. desperately need help with date sorting in XSL!!
    By yguo080 in forum XML Programming
    Replies: 2
    Last Post: March 3rd, 2004, 12:00 PM
  2. output every month, year between 2 dates
    By martincrumlish in forum PHP Development
    Replies: 2
    Last Post: February 2nd, 2004, 07:52 AM
  3. Replies: 0
    Last Post: November 2nd, 2003, 05:57 PM
  4. Php - how to retrieve month from date
    By jojomay in forum PHP Development
    Replies: 3
    Last Post: October 29th, 2003, 07:25 AM
  5. Replies: 3
    Last Post: October 28th, 2003, 02:50 AM

IMN logo majestic logo threadwatch logo seochat tools logo