← All errors

SQLCODE -180

SQL0180 Syntax of date, time or timestamp not valid

IBM message text
Syntax of date, time, or timestamp value not valid.
SQLCODE
-180
SQLSTATE
22007

Most common cause

A string converted to date, time or timestamp does not match the expected format: for example '10/05/2026' when the job uses *ISO.

Other causes

  • The program's date format (DATFMT on CRTSQLRPGI) or the JDBC or ODBC connection's differs from the data.
  • Separators other than the expected ones.

How to fix it

Use ISO literals ('2026-10-05'), which work with any format, or convert explicitly with TO_DATE or TIMESTAMP_FORMAT.

Related errors

Text and codes from IBM documentation for 7.6. Checked on .