How to retrieve comings birth days

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kamill
    New Member
    • Dec 2006
    • 71

    How to retrieve comings birth days

    Dear Strange Friends,

    I need to fetch birth date (in dd-mm format) in ascending order start from current date(dd-mm format), But i am unable to write appropriate query. i have stored dateofbirth in date format(yyyy-mm-dd) in mysql DB.

    i.e. if i have stored DOBs as 1999-07-11,2002-10-21,2004-06-15,2001-07-05,1994-08-17 and 2001-08-01 and current date is 2008-07-01 than my result must be looks like below

    2008-07-05 (05-07)
    1999-07-11 (11-07)
    2001-08-01 (01-08)
    1994-08-17 (17-08)
    2002-10-21 (21-10)
    2004-06-15 (15-06)

    But i have much frustrated to how to achieve this. Please Help.

    Thanks,
    Kamil
    Last edited by kamill; Jul 1 '08, 08:14 AM. Reason: Spelling mistake
  • hsriat
    Recognized Expert Top Contributor
    • Jan 2008
    • 1653

    #2
    Try to use DATE_FORMAT in the ORDER BY statement.

    Comment

    • amitpatel66
      Recognized Expert Top Contributor
      • Mar 2007
      • 2358

      #3
      ORDER BY Month - date in your query using DATE_FORMAT function as suggested in the above post

      Comment

      Working...