All Forums Database
tdreturn 25 posts Joined 10/12
10 Jun 2015
TO_DATE in "IN" clause

All,
We are trying to use TO_DATE in a IN clause and the syntax checker does not seem to like it. Here are some examples:
This works:

SELECT *

FROM (MEDC_C1prof "CD")

WHERE "CD".PAYMENT_DATE IN (TO_DATE('2014-11-01', 'YYYY-MM-DD'))

 

This DOES NOT work (as soon as you add another date)

SELECT *

FROM (MEDC_C1prof "CD")

WHERE "CD".PAYMENT_DATE IN (TO_DATE('2014-11-01', 'YYYY-MM-DD'), TO_DATE('2014-11-15', 'YYYY-MM-DD'))

 

I can get around this using OR but am trying to avoid that. Let me know. 

 

 

 

 

 

dnoeth 4628 posts Joined 11/04
10 Jun 2015

Don't ask me why, but Teradata doesn't allow any kind of calculation or function within IN.

Dieter

tdreturn 25 posts Joined 10/12
11 Jun 2015

Thanks Dieter. Technically is allows the calculation for one value but not for multiple. Hopefully they will fix it soon

You must sign in to leave a comment.