Details

Type: Bug

Status: Closed

Priority: Major

Resolution: Fixed

Affects Version/s: 10.4.2.0

Fix Version/s: 10.6.1.0

Component/s: Documentation

Labels:None

Environment:MS Windows XP Professional Version 2002 Service Pack 2, running NetBeans IDE 6.5

Urgency:Normal
Description
When Derby Reference Manual, version 10.4, lists Derby limitations for DATE is said that the smallest DATE value is 00010101 and the largest DATE value is 99991231.
When the same manual explains the DATE function is said that:
"The argument must be ... a positive number less than or equal to 2,932,897 ... The result is the date that is n1 days after January 1, 0001, where n is the integral part of the number."
Testing for the largest integer returns the expected result:
select date(2932897) from SYSIBM.SYSDUMMY1 returns 99991231 > OK
The problem comes when testing the smallest integer. We get a result different than we expect:
select date(1) from SYSIBM.SYSDUMMY1 returns 19700101, but it should have returned 00010101
The smallest date we get using integer as an argument to date function should be the same we get when using the smallest string representation as an argument. In other words date(1) should be equal to date('00010101').
select date('00010101') from SYSIBM.SYSDUMMY1 returns 00010101 > OK
Issue Links
 is related to

DERBY4106 The Reference Gulde claims that the INTEGER function can be applied to dates and times
 Closed
This problem may be related to
DERBY4106issue.