Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[SOLVED] mysql: ERROR 1292 (22007): Incorrect date value: '0000-00-00'

Programming languages, Coding, Executables, Package Creation, and Scripting.
Post Reply
Message
Author
MakeTopSite
Posts: 115
Joined: 2021-01-20 08:44
Has thanked: 8 times

[SOLVED] mysql: ERROR 1292 (22007): Incorrect date value: '0000-00-00'

#1 Post by MakeTopSite »

Code: Select all

mysql> UPDATE some_table SET some_date_column='2024-04-10' WHERE some_date_column='0000-00-00' ;
ERROR 1292 (22007): Incorrect date value: '0000-00-00' for column 'some_date_column' at row 1
Server version: 8.0.26 MySQL Community Server - GPL

What is please optimal solution ?
Last edited by MakeTopSite on 2024-05-11 09:00, edited 1 time in total.

User avatar
ruwolf
Posts: 657
Joined: 2008-02-18 05:04
Location: Banovce nad Bebravou
Has thanked: 45 times
Been thanked: 30 times

Re: mysql: ERROR 1292 (22007): Incorrect date value: '0000-00-00'

#2 Post by ruwolf »


MakeTopSite
Posts: 115
Joined: 2021-01-20 08:44
Has thanked: 8 times

Re: mysql: ERROR 1292 (22007): Incorrect date value: '0000-00-00'

#3 Post by MakeTopSite »

ruwolf wrote: 2024-04-10 20:11 MySQL: sql_mode: NO_ZERO_DATE
MariaDB: sql_mode: NO_ZERO_DATE
Thank you, it's solved by

Code: Select all

UPDATE some_table SET some_date_column='2024-04-10'
WHERE some_date_column IS NULL;

Post Reply