Subject Re: Extract Problem
Author elitalaw
hehehe...this is my original posting...

I have these query which work perfectly fine

SELECT * FROM JCMBRARCLOSINGBAL JC WHERE
JC.PERIOD = EXTRACT(YEAR FROM CAST('2004-04-18' AS DATE))* 100 +
EXTRACT(MONTH FROM CAST('2004-04-18' AS DATE)) - 1

but when i try to pass a parameterized query

SELECT * FROM JCMBRARCLOSINGBAL JC WHERE
JC.PERIOD = EXTRACT(YEAR FROM CAST(? AS DATE))* 100 +
EXTRACT(MONTH FROM CAST(? AS DATE)) - 1

The parameters passed are class java.sql.Date
i got an error

SQL error code = -105
Specified EXTRACT part does not exist in input datatype

any idea on this?

thx,
eLita