Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2003

    Question Unanswered: Date format problems

    I have just setup my very first SQL database and it works, hurra !!!
    However, I cannot upload a date field from my ASP-page to the corresponding date field in my MySQL database.

    I am retrieving the date on my ASP-page with the command 'now()' in the dd-mm-yyyy format. I then want to push the data to my database field (data type: 'DATE') but I can see that MySQL only accepts date formats as yyyy-mm-dd.

    Is there an easy way out or do I have to manually rearrange the date format?

    // Tveden

  2. #2
    Join Date
    Apr 2002
    Toronto, Canada
    no, mysql accepts '16-01-2003' just fine

    the easiest solution is to tell mysql to use the current date, instead of trying to pass in a date string

    in other words, instead of

    INSERT INTO yourtable (yourdate) VALUES ( 'ASP string' )

    try this

    INSERT INTO yourtable (yourdate) VALUES ( SYSDATE() )


Posting Permissions

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