ORA-01843: not a valid month
A string converted to a date has a month Oracle doesn't accept for the format in use, often because the session's NLS_DATE_FORMAT or language differs from the data.
- Error code
ORA-01843- Category
- Data values and conversion
What it means
ORA-01843 means the month part of a date string didn't match the format model. Without an explicit format, TO_DATE and implicit conversions use the session's NLS_DATE_FORMAT and NLS_DATE_LANGUAGE, so the same SQL can work for one user and fail for another.
Newer releases word it as An invalid month was specified.
Common causes
- Relying on implicit conversion:
WHERE order_date = '2026-11-09'with a session format ofDD-MON-RR. - Day and month swapped between formats such as
MM/DDandDD/MM. - Month names in a language other than the session's
NLS_DATE_LANGUAGE.
How to fix it
-
Always give an explicit format, or use an ANSI date literal.
SELECT * FROM orders WHERE order_date >= DATE '2026-11-09'; SELECT TO_DATE('09/11/2026', 'DD/MM/YYYY') FROM dual; -
Pin the language for month names when needed.
SELECT TO_DATE('09-NOV-2026', 'DD-MON-YYYY', 'NLS_DATE_LANGUAGE=ENGLISH') FROM dual;
Related errors
ORA-01861literal does not match format stringORA-01830date format picture ends before end of input241SQL Server: Conversion failed for date and/or time22007PostgreSQL: invalid datetime format1292MySQL: Truncated incorrect value
More data values and conversion errors
ORA-12899value too large for columnORA-01401inserted value too large for columnORA-01438value larger than specified precisionORA-01722invalid numberORA-00932inconsistent datatypesORA-01476divisor is equal to zero
The code and message text are from the Oracle Database Error Help. Browse the full Oracle error list or search every database error.
Work on Oracle in SQLly
A native SQL client for macOS, Windows and Linux with schema-aware IntelliSense, guardrails for risky statements and clear error messages, for Oracle and the other databases you use.