Informix Error -1268: Invalid datetime or interval qualifier.
Cause and resolution
Invalid datetime or interval qualifier.
This statement contains a DATETIME or INTERVAL qualifier that is not acceptable. These qualifiers can contain only the words YEAR, MONTH, DAY, HOUR, MINUTE, SECOND, FRACTION, and TO. A number from 1 to 5 in parentheses can follow FRACTION. Inspect the statement for missing punctuation and misspelled words. A common error is adding an s, as in MINUTES.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-1268 fires when a DATETIME/INTERVAL qualifier isn't one of the accepted words — per the
official guidance, qualifiers can only contain YEAR, MONTH, DAY, HOUR, MINUTE,
SECOND, FRACTION, and TO, with an optional parenthesized number from 1 to 5 following
FRACTION. The official guidance notes common mistakes include pluralizing a keyword (e.g.
MINUTES instead of MINUTE), missing punctuation, and misspellings.
- A pluralized keyword (e.g.
MINUTESinstead ofMINUTE), per the official guidance's specifically named common mistake. - A misspelled qualifier keyword, per the official guidance's other named cause.
- Missing punctuation in the qualifier clause, per the official guidance's other named cause.
Solutions / Resolution
- Use only the accepted qualifier words (
YEAR,MONTH,DAY,HOUR,MINUTE,SECOND,FRACTION,TO), per the official guidance, in their singular form. - Check the
FRACTIONprecision number (1 to 5) if used, per the official guidance.
Examples
A pluralized keyword
SELECT INTERVAL(30) MINUTES TO MINUTES FROM orders WHERE order_id = 1;
-- -1268: the correct keyword is MINUTE, not MINUTES
Corrected
SELECT INTERVAL(30) MINUTE TO MINUTE FROM orders WHERE order_id = 1;
Diagnostic Checks
- Check every qualifier keyword for correct spelling and singular form, and confirm any
FRACTIONprecision number is between 1 and 5.
Related Errors / Related Topics
- -1261 — "Too many digits in the first field of datetime or interval." A related literal- formatting error, about digit count rather than the qualifier keywords.
- -1262 — "Non-numeric character in datetime or interval." A related literal-formatting error, about the literal's own characters rather than its qualifier.
- -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.
- -1264 — "Extra characters at the end of a datetime or interval." A related literal- formatting error, about trailing characters.
A qualifier keyword is misspelled, pluralized, or otherwise invalid — use only YEAR/MONTH/
DAY/HOUR/MINUTE/SECOND/FRACTION/TO, singular and correctly spelled.