SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Evangelist cms9651's Avatar
    Join Date
    Mar 2010
    Posts
    407
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Incorrect date value in update query

    Hello everyone.

    Really I don't understand this error in update query MySQL:

    Code:
    UPDATE
    _myTable R 
    LEFT JOIN _yourTable C ON C.myNumber = R.yourNumber 
    SET R.yourOff = 1 
    WHERE (C.myLastDate <> '' OR C.myLastDate IS NOT NULL)
    
    Incorrect date value: '' for column 'myLastDate' at row 1
    I don't have null value of field 'myLastDate' in the _myTable.

    I hope your help.
    Thanks you very much for your help
    I'm really happy for your quickly answer.
    Good bye

  2. #2
    SitePoint Wizard guelphdad's Avatar
    Join Date
    Oct 2003
    Location
    St. Catharines, ON Canada
    Posts
    1,707
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can't insert ' ' into a date column so you can't compare it to an empty string. If you do you will end up with a warning or error message.

  3. #3
    SitePoint Evangelist cms9651's Avatar
    Join Date
    Mar 2010
    Posts
    407
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by guelphdad View Post
    You can't insert ' ' into a date column so you can't compare it to an empty string. If you do you will end up with a warning or error message.
    Thanks
    Thanks you very much for your help
    I'm really happy for your quickly answer.
    Good bye


Bookmarks

Posting Permissions

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