failure 22007: Invalid date/time/timestamp value

General
Enthusiast

failure 22007: Invalid date/time/timestamp value

Hi All,

 

I am facing issue while converting decimal(19,4) to time please help me with the fix

 

sel ( (col /100) (FORMAT '99:99:99') (CHAR(11)) (TIME(0)) ) from table

 

max(col)=6467747.0000

 

Thanks,

Pavan

1 REPLY 1
Teradata Employee

Re: failure 22007: Invalid date/time/timestamp value

Hi Pavan,

 

Well, conceptually you're wrong.

Just try with your max col value and before the conversion to time :

select (6467747.00 / 100) (format '99:99:99') (char(11));

06:46:77

You see easily this is not a good time.

 

Maybe you want to work something from the following?

select numtodsinterval(6467747.00 / 100, 'SECOND');

    0 17:57:57.470000