All Forums Database
dickinj 2 posts Joined 01/09
21 Jan 2009
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!

Adeel Chaudhry 773 posts Joined 04/08
22 Jan 2009

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

-- If you are stuck at something .... consider it an opportunity to think anew.

Petr Horcicka 29 posts Joined 12/08
22 Jan 2009

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

dickinj 2 posts Joined 01/09
23 Jan 2009

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

You must sign in to leave a comment.