DBAtlas · Database operations atlas

ORA-01843: not a valid month

Oracle

What does it mean?

While converting text to a DATE, the month part could not be interpreted as a valid month. Usually the date format does not match the format of the data.

Why does it happen?

No format mask passed to TO_DATE and the session's NLS_DATE_FORMAT does not match the data; day and month swapped (DD/MM vs MM/DD confusion); a language/locale difference (in month names); corrupted or unexpected date text.

How to fix it

Always pass an explicit format in TO_DATE calls: TO_DATE('2026-07-04', 'YYYY-MM-DD'). For text containing month names, specify the language: TO_DATE(str, 'DD-MON-YYYY', 'NLS_DATE_LANGUAGE=ENGLISH'). Set the session format if needed: ALTER SESSION SET NLS_DATE_FORMAT = 'YYYY-MM-DD'. Validate invalid date text before loading.

Open in DBAtlas →

More from this engine