cancel
Showing results for 
Search instead for 
Did you mean: 

Date Exception

Former Member
0 Kudos

hai to every one ,

i getting error while getting data from database.

i used the data dictionary prospective devloped table.

and inserted data to table. in that i have the date field.

i assigned in that as type = Date

then i wriiten method in java to retrive the data by Date criteria it showing Error like as follow.

i used the date type in java as Java.sql.date.

when assigned to TaskDate in dictionary date type.

what i need to do help me. pl

The SQL statement "SELECT * FROM "TASK_DETAILS" WHERE "TASK_RECEIPT_DATE" = '2008-09-24' ORDER BY 1,2" contains the semantics error[s]: - 1:34 - type check error: the left hand side >>"TASK_DATE"<< (DATE) and the right hand side >>'2008-09-24'<< (CHAR) of a comparison operator are not comparable

Accepted Solutions (1)

Accepted Solutions (1)

former_member185029
Active Contributor
0 Kudos

You will have to use the query as


Date sqlDateObject = new Date(System.currentTimeInMillis());

"SELECT * FROM "TASK_DETAILS" WHERE "TASK_RECEIPT_DATE" = '" + sqlDateObject + "' ORDER BY 1,2"

-Ashutosh

Former Member
0 Kudos

hai thanks for giving reply .

But in System.currentTimemills(); is using current time .

here we need to pass date form user end, the date will avialble in

taskRecDate at run time ,it is java.util.date type.

former_member185029
Active Contributor
0 Kudos

Hi,

I understand that you do not need currentDateTime...the code snipet is just an example how you can pass the SQL Date.

Further you can initialize the SQL Date object as


Date sqlDateObject = new Date(utilDateObject.getTime());

-Ashutosh

Former Member
0 Kudos

Hai ,

its happy to see u r messages , but i done what u given but the error is same , that is like as blow .

i think the dictionary date is not matched with sql Date , my assume is write!

here we can note that CHAR type is assigned , how it is possible .

no where i not assigned to any of attribute is CHAR.

The SQL statement "SELECT * FROM "TASK_DETAILS" WHERE "TASK_RECEIPT_DATE" = '2008-09-24' ORDER BY 1,2" contains the semantics error[s]: - 1:34 - type check error: the left hand side >>"TASK_RECEIPT_DATE"<< (DATE) and the right hand side >>'2008-09-24'<< (CHAR) of a comparison operator are not comparable

Answers (0)