Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

ODBC Oracle Datetime problem

Dear All,

I am new to qlikview,

I try to retrieve record from DB with  SQL statement Below.

statement:

select * from itemdm where lastmodtime > TO_DATE($(vMax),'YYYY-MM-DD HH24.MI.SS');

debugger returns:

SQL##f - SqlState: S1000, ErrorCode: 907, ErrorMsg: [Oracle][ODBC][Ora]ORA-00907: missing right parenthesis

New:

select * from xf_itemdm where xf_lastmodtime > TO_DATE(2013-05-20 17.05.41,'YYYY-MM-DD HH24.MI.SS')

I guess this msg is due to missing pair of  '  ,

can anyone teach me how to handle it?

and I found it there's a date but no datetime function,
Any ways suggested to handle the date, string and datetime  conversion?

Thx !!!

3 Replies
Sokkorn
Master
Master

Hi calvinlin,

First try this: SQL select * from itemdm where lastmodtime > TO_DATE($(vMax),'YYYY-MM-DD HH24.MI.SS');

If not work then try select * from itemdm where lastmodtime > Chr(39) & TO_DATE($(vMax),'YYYY-MM-DD HH24.MI.SS') & Chr(39);

Regards,

Sokkorn

Not applicable
Author

Dear Sokkorn,

Chr(39) works if i store the variable before the sql statement like this:

let vMax = chr(39)&DATE(peek('maxDate',-1,Temp),'YYYY-MM-DD HH.MM.SS')&chr(39);

when undergoing the sql statement, the vMax contains the pairs of 's

Thanks a lot !

Calvin Lin

Sokkorn
Master
Master

Dear Calvin,

Sound great. My script is just an idea for your to us Chr(39), but you can get it done with your actual script.

Cheer!!!

Sokkorn