All Forums Teradata Studio
Jerem4205 2 posts Joined 09/14
04 May 2015
Problem with Cast and parameter


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 ?


fgrimmer 553 posts Joined 04/09
04 May 2015

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.

Jerem4205 2 posts Joined 09/14
06 May 2015

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 !

You must sign in to leave a comment.