Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2004
    Location
    USA
    Posts
    4,345

    * MYSQL Date Filed Not Getting Right Value

    Greetings,

    I tried this query:

    INSERT INTO airplane (`plate_num`,`name`,`group`,`hoop_time`,`insp_due`,`ann_insp_1`,`ann_insp_2`,`ann_insp_3`) VALUES ('test','test','1','test','0000-25-02','0000-29-03','0000-26-02','0000-29-05')

    where insp_due to ann_insp_3 are Date fileds in 0000-00-00 format...

    The result I am getting on my database is all zeros inplace of the dates and not inserted value?

    Peace,
    Testing 1.. Testing 1..2.. Testing 1..2..3...

  2. #2
    Join Date
    Jan 2003
    Posts
    1,715
    If you give a program invalid data, expect an invalid response.

    I'm not sure what you're trying to do, but the DATE range starts at 1000-01-01. If you give it invalid data, MySQL will push it to the nearest valid point, in this case the zero value.
    Game Servers are the next hot market!
    Slim margins, heavy support, fickle customers, and moronic suppliers!
    Start your own today!

  3. #3
    Join Date
    Mar 2004
    Location
    USA
    Posts
    4,345
    Originally posted by hiryuu
    If you give a program invalid data, expect an invalid response.

    I'm not sure what you're trying to do, but the DATE range starts at 1000-01-01. If you give it invalid data, MySQL will push it to the nearest valid point, in this case the zero value.

    aha..

    i think i got my mistake..

    i thought it was year-month-day

    but it is year-day-month

    i had to correct that

    thanx thou

    peace,
    Testing 1.. Testing 1..2.. Testing 1..2..3...

  4. #4
    Join Date
    Jan 2003
    Posts
    1,715
    It is yyyy-mm-dd. That allows it to be sorted as text, when needed, and still produce proper date order.
    Game Servers are the next hot market!
    Slim margins, heavy support, fickle customers, and moronic suppliers!
    Start your own today!

Posting Permissions

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