Discussion:
TRUNC not null datetime 1260: It is not possible to convert between the specified types
(too old to reply)
Wlodek
2014-02-01 20:53:55 UTC
Permalink
Hi group

If I try this

create table t1 (
d datetime year to fraction
);
insert into t1 values ('2014-01-31 12:00:00');
select TRUNC(d) from t1;

it's OK.

But adding NOT NULL to column

create table t2 (
d datetime year to fraction NOT NULL
);
insert into t2 values ('2014-01-31 12:00:00');
select TRUNC(d) from t2;

retults in:

1260: It is not possible to convert between the specified types

What's the problem with that NOT NULL?

I'm using IDS 11.70/Linux.


Thanx
Wlodek
Doug Lawry
2014-02-03 12:30:39 UTC
Permalink
Hi Wlodek.

Strange usage/behaviour, but this works in either case and is better defined:

select date(d) :: datetime year to fraction from t2;

Regards,
Doug Lawry

Loading...