Re: extend differences
Posted in 2000
Topics: General Discussion
BTW, promoting the date to a datetime by extending it will solve the
problem, but for our purposes it is not a viable solution.
(e.g. select * from D, DT where extend(D.d, year to fraction(5)) =
extend('1988-10-28 06:01:00.00', year to fraction(5));
returns no data).
-- Previous message
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 D, DT where d = dt;
-- this statment does return data. It appears as if the datetime is
truncated to a date...
select * from D, DT 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