TO_DATE in "IN" clause

Database
Enthusiast

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. 

2 REPLIES
Junior Contributor

Re: TO_DATE in "IN" clause

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

Enthusiast

Re: TO_DATE in "IN" clause

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