CAST TIME Problem

Database

CAST TIME Problem

All,

I'm a Teradata newbie and have run across the following problem. The following statement fails with error 5407: Invalid operation on an ANSI Datetime or interval value:

SELECT CAST(column-name AS TIME(0)) FROM database-name.table-name

"column-name" is defined as a TIME(0) itself. Why does casting a TIME(0) to a TIME(0) fail?

If you think this is silly, it is. The SQL that contains it is generated by a purchased application package.

Nothing I could find in the Teradata documentation addresses this, so any help would be appreciated. Thanks!
3 REPLIES
Teradata Employee

Re: CAST TIME Problem

Hello,

Have you tried running the same query from BTEQ or SQL Assistant? Or try to cast it as VARCHAR. Does that work?

Regards,

Adeel

Enthusiast

Re: CAST TIME Problem

Hi,
I'm just guessing. If the application would use ODBC, check the option DateTime Format (appears after pushing the button Options) default is "III" and change it to "AAA".

Petr

Re: CAST TIME Problem

Adeel and Petr,

I appreciate your responses. I changed the DateTimeFormat to AAA and that solved the problem. Thank you very much!