Informix Error -1264: Extra characters at the end of a datetime or interval.
Cause and resolution
Extra characters at the end of a datetime or interval.
Only spaces can follow a DATETIME or INTERVAL literal. Inspect this statement for missing or incorrect punctuation.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-1264 fires when a DATETIME/INTERVAL literal has non-space characters after its final,
expected field — per the official guidance, only spaces are allowed to follow the literal.
- Extra characters after the literal's final field, per the official guidance — the direct, only cause, often from a missing or incorrectly placed punctuation mark elsewhere in the statement.
Solutions / Resolution
- Inspect the statement for missing or incorrect punctuation, per the official guidance — trailing characters often indicate a delimiter or closing punctuation issue elsewhere nearby.
Examples
Extra trailing characters
SELECT DATETIME(2024-01-15 10:30:00x) YEAR TO SECOND FROM orders WHERE order_id = 1;
-- -1264: the stray 'x' follows the literal's final recognized field (seconds)
Corrected
SELECT DATETIME(2024-01-15 10:30:00) YEAR TO SECOND FROM orders WHERE order_id = 1;
Diagnostic Checks
- Check for any non-space character immediately following the literal's expected final field, and inspect nearby punctuation for the actual source of the mistake.
Related Errors / Related Topics
- -1261 — "Too many digits in the first field of datetime or interval." A related literal- formatting error, about the first field's digit count.
- -1262 — "Non-numeric character in datetime or interval." A related literal-formatting error, about invalid characters within the literal itself.
- -1263 — "A field in a datetime or interval is out of range, incorrect, or missing." A related literal-validity error, about a field's value rather than trailing characters.
Non-space characters follow the literal's final field — inspect nearby punctuation for the actual mistake.