-181 THE STRING REPRESENTATION OF A DATETIME VALUE IS NOT A VALID DATETIME VALUE
Explanation
The string representation of a datetime is not in the acceptable range or is not in the correct format. The proper ranges for datetime values are as follows:
Datetime | Specific Cases | Numeric Range |
---|---|---|
Years | 0001 to 9999 | |
Months | 1 to 12 | |
Days | For months:
|
1 to 30 |
For February (month 2) | 1 to 28 (Years other than leap years.) | |
1 to 29 (Leap years only.) | ||
For months:
|
1 to 31 | |
Hours | If the format for hours is USA | 0 to 12 |
For all other predefined formats | 0 to 24 | |
Minutes 1 | 0 to 59 | |
Seconds 1 | 0 to 59 | |
Fractional seconds 1 | 0 to 999999 | |
Time zone hours | -12 to 14 | |
Time zone minutes | 0 to 59 | |
Note:
|
System action
The statement cannot be processed.
Programmer response
Check whether the value is within the valid range and is in the proper format. Correct the syntax, and reissue the statement.
SQLSTATE
22007