extend differences
Posted in 2000
Topics: General Discussion
Can anyone tell me why the extend function behaves differently for
attributes and for constants? Here is an example:
create table D (d date);
create table DT (dt datetime year to fraction(2));
insert into D values ('10/28/1988');
insert into DT values ('1988-10-28 06:01:00.00');
-- returns no data, as you would expect it not to: the date is promoted to a
datetime, same date but at midnight
select * from Da, DTa where d = dt;
-- this statment does return data. It appears as if the datetime is
truncated to a date...
select * from Da, DTa where Da.d = extend('1988-10-28 06:01:00.00', year tofraction(5));
-- this statment returns exactly the same string as in the literal in the
previous statement
select extend('1988-10-28 06:01:00.00', year to fraction(5)) as x from DT
Explicitly converting the datetime string to a datetime then extending the
qualifier does not work, either. Am I missing something?
Ben