Informix Error -1204: Invalid year in date.
Cause and resolution
Invalid year in date.
The year in a DATE value or literal is invalid. For example, the number 0000 is not acceptable as the year.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-1204 fires when a DATE value or literal's year component is invalid — per the official
guidance, 0000 is a specific example of an unacceptable year.
- A
DATEliteral with year0000, per the official guidance's specific example — the direct, named cause. - A
DATEvalue computed or parsed with a year outside the supported range, more generally, from a malformed source string or an off-by-one date computation.
Solutions / Resolution
- Correct the year to a valid value, per the official guidance —
0000specifically isn't acceptable. - Check the source of the date value (a literal, a parsed string, or a computed expression) for where the invalid year originated.
Examples
An invalid year
INSERT INTO orders (order_id, order_date) VALUES (1, '01/01/0000');
-- -1204: year 0000 is not a valid DATE year
Corrected
INSERT INTO orders (order_id, order_date) VALUES (1, '01/01/2000');
Diagnostic Checks
- Check the year component of the date value/literal for validity, and trace back to wherever it was computed or parsed if it's not a literal typo.
Related Errors / Related Topics
- -1205 — "Invalid month in date." A related date-validity error, about the month component rather than the year.
- -1206 — "Invalid day in date." A related date-validity error, about the day component rather than the year.
The date's year component is invalid (e.g. 0000) — correct it, or trace back to where it was
computed/parsed.