Issue Details (XML | Word | Printable)

Key: DERBY-161
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Unassigned
Reporter: George Baklarz
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Derby

DATE function as documented in the manuals does not support integer arguments. i.e. DATE(1232) does not work although the manual specifies that this format will return a date field that is "x" number of days since day 0.

Created: 05/Mar/05 04:41 AM   Updated: 29/Apr/05 09:39 AM
Return to search
Component/s: SQL
Affects Version/s: 10.0.2.0
Fix Version/s: 10.1.1.0

Time Tracking:
Not Specified

Environment: Windows XP Professional SP 1

Resolution Date: 29/Apr/05 09:39 AM


 Description  « Hide
The DATE function returns a date from a value. The argument must be a date, timestamp, a positive number less than or equal to 3,652,059, a valid string representation of a date or timestamp, or a string of length 7 that is not a CLOB or LONG VARCHAR. If the argument is a string of length 7, it must represent a valid date in the form yyyynnn, where yyyy are digits denoting a year, and nnn are digits between 001 and 366, denoting a day of that year. The result of the function is a date. If the argument can be null, the result can be null; if the argument is null, the result is the null value. The other rules depend on the data type of the argument specified:
  - If the argument is a date, timestamp, or valid string representation of a date or timestamp: The result is the date part of the value.
  - If the argument is a number: The result is the date that is n-1 days after January 1, 0001, where n is the integral part of the number.
  - If the argument is a string with a length of 7: The result is the date represented

The DATE function does not support integer argument.

ij> values date(12345);
ERROR 42846: Cannot convert types 'INTEGER' to 'DATE'.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Satheesh Bandaram added a comment - 29/Apr/05 09:39 AM
Submitted Jack's patch for datetime issues. That should solve this.

Satheesh Bandaram added a comment - 29/Apr/05 09:39 AM
Fix checkedin.