← All errors

SQLCODE -183

SQL0183 Result of date arithmetic out of range

IBM message text
Result of date or timestamp expression not valid.
SQLCODE
-183
SQLSTATE
22008

Most common cause

Adding or subtracting durations takes the date before 0001-01-01 or after 9999-12-31.

Other causes

  • Sentinel dates such as 9999-12-31 with days added.
  • Two-digit-year formats with a result outside 1940-2039.

How to fix it

Exclude sentinel dates from the calculation with a CASE or in WHERE. For two-digit years use an *ISO, *EUR, *USA or *JIS format.

Related errors

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