Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2004
    Posts
    3

    Unanswered: yyyy-mm-dd format probs

    I know very little SQL and I am using phpMyAdmin to upload a text file to my database.

    The text file contains dates in the format d/m/yy (so 1st feb would be 1/2/04 without any leading zeros). And it appears that they have to be in yyyy-mm-dd format in the database.

    How can I upload this text file so the dates will insert correctly into the date fields?

    Is there some SQL code that can do this? However I did try to use SQL before to upload my text file, but couldn't get it working, hence the reason I got phpMyAdmin.

    Thanks in advance.

    Sam

  2. #2
    Join Date
    Sep 2003
    Location
    So. Cal. USA
    Posts
    142
    GGGGGgrrrrrrrr!!! Aaaaaarrrrrggghhhh!!! I have lost my long response to you 2x now because the system complained I was not logged in and then dumped my post.

    In short to summarize, though... I had a similar problem HERE but it was the reverse. You may be able to use something like PHP's strtodate() function but I think you'd still have to use substr() to get the correct format.

    If you are not a programmer, you can probably just use Word/Excel to split the dates into 3 columns, add preceding 0's and 19xx/20xx characters, rearrange columns to yyyymmdd order, and remove delimiters.

    I hope this helps.
    --ST

  3. #3
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Quote Originally Posted by Steve T.
    GGGGGgrrrrrrrr!!! Aaaaaarrrrrggghhhh!!! I have lost my long response to you 2x now because the system complained I was not logged in and then dumped my post.
    dbforums.com has been getting "corn-fused" a bit lately. Just because I'm a paranoid soul, I copy my response to the clipboard before I submit it. That helps to keep my blood presure down.

    -PatP

Posting Permissions

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