Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2004

    Question Unanswered: Need Help on Date issue!

    Hi there!

    I really need some help on the current date issue that I am having.

    I created a field in MySQL under TEXT format and stored my date there (DD/MM/YYYY). I know it's stupid to do that, but I did it and didn't think of it at that time.

    Anyway, currently I need to sort the dates and could not figure out a way to convert those dates into SQL readable format (YYYY-MM-DD). What can I do? Does anyone know how to convert a TEXT field (DD/MM/YYYY) to the SQL readable format?

    I seriously need help. If anyone out there knows how to do it, please help me out. I'm extremely desprate here!

    By the way, I am programming in PHP. Thank you for your help!

    Worried Guy.

  2. #2
    Join Date
    Aug 2004
    Your going to have to redo your date system. There is no way to change that that I know, sorry.

  3. #3
    Join Date
    Apr 2002
    Toronto, Canada
    select foo
         , bar
         , concat_ws('-'
            , substring(textdate,7,4)
            , substring(textdate,4,2)
            , substring(textdate,1,2)) as realdate
      from yourtable
        by realdate | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts