Informix Error -1206: Invalid day in date.
Cause and resolution
Invalid day in date.
The day number in a DATE value or literal must a one- or two-digit number from 1 to 28 (or 29 in a leap year), 30, or 31, depending on the month that accompanies it.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-1206 fires when a DATE value or literal's day component is invalid — per the official
guidance, the day must be a one- or two-digit number from 1 to 28 (or 29 in a leap year), 30, or
31, depending on the accompanying month.
- A day value outside the valid range for its month, per the official guidance — for example, day 31 with a 30-day month, or day 30 with February.
- February 29 used in a non-leap year, per the official guidance's specific leap-year framing.
- A
DATEvalue computed or parsed with an out-of-range day, from a malformed source string or a date-arithmetic error.
Solutions / Resolution
- Correct the day to a value valid for its month (and, for February 29, for the year), per the official guidance.
- Check the source of the date value (a literal, a parsed string, or a computed expression) for where the invalid day originated.
Examples
An invalid day for the month
INSERT INTO orders (order_id, order_date) VALUES (1, '02/30/2024');
-- -1206: February has no 30th day
Corrected
INSERT INTO orders (order_id, order_date) VALUES (1, '02/29/2024');
-- valid: 2024 is a leap year
Diagnostic Checks
- Check the day component against the valid range for its month and year, and trace back to wherever it was computed or parsed if it's not a literal typo.
Related Errors / Related Topics
- -1204 — "Invalid year in date." A related date-validity error, about the year component rather than the day.
- -1205 — "Invalid month in date." A related date-validity error, about the month component rather than the day.
The date's day component fell outside the valid range for its month (or February 29 in a non-leap year) — correct it, or trace back to where it was computed/parsed.