mysqldude
Error codes › 1292

MySQL & MariaDB error 1292: Incorrect date / datetime value (truncated incorrect value)

Error messageTruncated incorrect … value: '…'
Example from our test runs: Incorrect date value: '01/23/08' for column 'sdate' at row 1 (5.7.44)

A value can't be converted to a valid DATE, DATETIME or TIMESTAMP, or a string-to-number conversion lost data. In strict mode inserts fail; elsewhere it is a warning.

MySQLMariaDB
SymbolER_TRUNCATED_WRONG_VALUEER_TRUNCATED_WRONG_VALUE
SQLSTATE2200722007
TypeServer errorServer error
Versionsevery release since 5.0 activeevery release since 5.5 active

What it means

Incorrect date value: '2024-02-30' for column 'd' at row 1. MySQL and MariaDB only accept dates they can parse as YYYY-MM-DD (or a few compatible forms) that exist on the calendar. In SELECT expressions the same problem appears as a warning: Truncated incorrect DOUBLE value: 'abc'.

Why it happens

  • Impossible dates (February 30th) or other formats such as 25/12/2024 or 12-25-2024.
  • The zero date 0000-00-00 or zero parts (2024-00-10): rejected by NO_ZERO_DATE / NO_ZERO_IN_DATE, which are part of strict mode on MySQL 5.7+. MariaDB’s default sql_mode doesn’t include them, so zero dates are still accepted there (our tests confirm).
  • Upgrading from MySQL 5.6 (non-strict by default), where bad dates were stored as 0000-00-00 with a warning.
  • TIMESTAMP values outside 1970–2038.
  • Comparing a string column to a number (WHERE varchar_col = 0) produces 1292 warnings for every non-numeric row.

How to fix it

  • Convert other formats explicitly: STR_TO_DATE('25/12/2024', '%d/%m/%Y').
  • Use NULL for unknown dates instead of 0000-00-00, and make the column nullable.
  • Clean existing zero dates before upgrading: UPDATE t SET d = NULL WHERE d = '0000-00-00'; (run it with a relaxed session sql_mode if the server refuses to read them).
  • Compare strings with strings: WHERE varchar_col = '0'.

Reproduce it yourself

These steps are the exact test our harness runs. Use a scratch server, never production.

  1. Connect with mysql -u root -p and create a scratch database and the test data:

    CREATE DATABASE demo;
    USE demo;
    CREATE TABLE ev (d DATE);
  2. Run:

    INSERT INTO ev VALUES ('2024-02-30');

You get: Incorrect date value: '2024-02-30' for column `t_0`.`ev`.`d` at row 1(11.8.9)

Verified fixes

  1. Parse non-ISO input with STR_TO_DATE

    INSERT INTO ev VALUES (STR_TO_DATE('25/12/2024', '%d/%m/%Y'));
    SELECT CAST(d AS CHAR) FROM ev;

Tested on

StepMySQLMariaDB
5.65.78.08.4910.610.1111.411.8
Insert an impossible date (strict mode)
repro
≠✓ 1292✓ 1292✓ 1292✓ 1292✓ 1292✓ 1292✓ 1292✓ 1292
A date in day/month/year format
version check
≠✓ 1292✓ 1292✓ 1292✓ 1292✓ 1292✓ 1292✓ 1292✓ 1292
The zero date '0000-00-00' (NO_ZERO_DATE in strict mode)
version check
≠✓ 1292✓ 1292✓ 1292✓ 1292≠≠≠≠
Parse non-ISO input with STR_TO_DATE
fix
✓✓✓✓✓✓✓✓✓
Insert an impossible date (strict mode) repro
MySQL 5.6≠5.7✓ 12928.0✓ 12928.4✓ 12929✓ 1292
MariaDB 10.6✓ 129210.11✓ 129211.4✓ 129211.8✓ 1292
A date in day/month/year format version check
MySQL 5.6≠5.7✓ 12928.0✓ 12928.4✓ 12929✓ 1292
MariaDB 10.6✓ 129210.11✓ 129211.4✓ 129211.8✓ 1292
The zero date '0000-00-00' (NO_ZERO_DATE in strict mode) version check
MySQL 5.6≠5.7✓ 12928.0✓ 12928.4✓ 12929✓ 1292
MariaDB 10.6≠10.11≠11.4≠11.8≠
Parse non-ISO input with STR_TO_DATE fix
MySQL 5.6✓5.7✓8.0✓8.4✓9✓
MariaDB 10.6✓10.11✓11.4✓11.8✓
✓works ✓ 1062fails with the error the step demonstrates ⚠works with a warning ≠runs, result differs ✗fails Tested 2026-11-25 on 5.6.51, 5.7.44, 8.0.46, 8.4.13, 9.7.4, 10.6.28, 10.11.19, 11.4.13, 11.8.9
What the warnings and failures say (3)
  • Insert an impossible date (strict mode) (MySQL 5.6): expected error 1292 did not occur
  • A date in day/month/year format (MySQL 5.6): expected error 1292 did not occur
  • The zero date '0000-00-00' (NO_ZERO_DATE in strict mode) (MySQL 5.6, MariaDB 10.6, MariaDB 10.11, MariaDB 11.4, MariaDB 11.8): expected error 1292 did not occur

Related errors

  • 1366 ER_TRUNCATED_WRONG_VALUE_FOR_FIELDexplained
  • 1067 ER_INVALID_DEFAULTexplained
  • 1406 ER_DATA_TOO_LONGexplained

Where this error shows up in our guides

  • LOAD DATA INFILE variable data · Date in the wrong format without SET conversion MySQL 5.7 8.0 8.4 9MariaDB 10.6 10.11 11.4 11.8
  • TIMEDIFF · TIMEDIFF over ~35 days is capped at 838:59:59 (TIME range) MySQL 5.6 5.7 8.0 8.4 9MariaDB 10.6 10.11 11.4 11.8
How the message changed between versions
MariaDB fromSymbolMessage
5.5.68ER_TRUNCATED_WRONG_VALUETruncated incorrect %-.32s value: '%-.128s'
10.2.44ER_TRUNCATED_WRONG_VALUETruncated incorrect %-.32T value: '%-.128T'
11.8.10ER_TRUNCATED_WRONG_VALUETruncated incorrect %-.32sT value: '%-.128sT'