Problem with Cast and parameter

Teradata Studio

Problem with Cast and parameter

Hello,

I'm facing a little issue with Studio 15.10.

When I execute the following request, everything works fine :

select CAST( '2015-01-01' AS DATE FORMAT 'YYYY-MM-DD');

When I try the same request with a parameter (with the same value), I have the following error :

select CAST( ?\cal_d AS DATE FORMAT 'YYYY-MM-DD');

Executed as Single statement.  Failed [2665 : 22007] Invalid date.
Elapsed time = 00:00:00.019

STATEMENT 1: Select Statement failed.

Could you please tell me what I'm doing wrong ?

Regards,

Jérémie

2 REPLIES
Teradata Employee

Re: Problem with Cast and parameter

Jérémie, What value did you enter for the parameter cal_d? I ran the same query and entered 2015-01-01 for the parameter value and it worked. Do not quote the value in the Configure Parameters pop up.

Re: Problem with Cast and parameter

Hello Francine,

You're right, I tried to pass '2015-01-01' , with quote, and it didn't work.

Whithout quotes everything is ok.

Thanks !

Jeremie