Oracle errors

ORA-01843: not a valid month

ORA-01843: not a valid month

A date string has a month Oracle cannot accept for the format in use. Usually the day and month are swapped, the month name is in another language, or the session’s default date format differs. Always use TO_DATE with an explicit format.

What ORA-01843 means

When Oracle converts text to a date, it reads the text according to a format mask, or the session’s NLS_DATE_FORMAT if there is none. If the part in the month position is not a valid month, ORA-01843 follows. A query that works in one tool can fail in another simply because their NLS settings differ.

Common causes of ORA-01843

How to fix ORA-01843

  1. Use an explicit mask: TO_DATE('2026-10-15', 'YYYY-MM-DD').
  2. Or use an ANSI date literal, which has a fixed format: DATE '2026-10-15'.
  3. For month names, set the language in the call: TO_DATE('15 OCAK 2026', 'DD MONTH YYYY', 'NLS_DATE_LANGUAGE=TURKISH').
  4. Find bad rows: VALIDATE_CONVERSION(col AS DATE, 'YYYY-MM-DD') = 0 (Oracle 12.2 and later).

ORA-01843 example

There is no month 13:

-- ORA-01843: not a valid month
SELECT TO_DATE('2026-13-01', 'YYYY-MM-DD') FROM dual;

-- A date literal has no NLS dependency
SELECT DATE '2026-10-15' FROM dual;

In SQLlightspeed

When a statement fails, SQLlightspeed’s error panel shows the error code with a plain-language explanation and a suggestion for what to do next, together with Oracle’s own message and a link to Oracle’s documentation — for this error and dozens of other common ones.

Related errors

ORA-01861ORA-00932ORA-01722 All Oracle errors →

Oracle documentation for ORA-01843. Oracle is a registered trademark of Oracle Corporation. SQLlightspeed is not affiliated with Oracle.