Icon View Incident Report

Serious Serious
Reported By: Richard Harding
Reported On: 3/8/2007
For: Version 1.01 Build 1
# 2266 Cannot Subtract Two Date Values as a Year Interval

I am attempting to move Age calculations from the application to the DB - without success.

DateOfBirth is defined as a DATE column.
Added a new column AGE with a type of INTERVAL YEAR.

The calculation expression is CURRENT_DATE - DateOfBirth.

The error message is: (Expected NULL, SmallInt, BigInt, Interval or Year expression but instead found CURRENT_DATE - "DateOfBirth")


Comments Comments
The error was correct in that you cannot assign a day-time interval to a year-month interval column. The default result of subtracting to date values is a day-time interval of the type INTERVAL DAY and the defined column being assigned to is defined as the type INTERVAL YEAR.

The issue is that ElevateDB did not support the SQL:2003 standard syntax for specifying the interval type when subtracting two dates, times, or timestamps:

(CURRENT_DATE - DateOfBirth) YEAR

ElevateDB now supports this syntax.

Another minor side issue was that the error message text was slightly wrong.


Resolution Resolution
Fixed Problem on 3/9/2007 in version 1.02 build 1


Products Affected Products Affected
ElevateDB Additional Software and Utilities
ElevateDB VCL Client-Server
ElevateDB VCL Client-Server with Source
ElevateDB VCL Standard
ElevateDB VCL Standard with Source
ElevateDB VCL Trial

Image