Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Use Date to query oracle db error

Hi Guys,

Oracle DB SyncDate field format:

DD/MM/YYYY hh:mm:ss

SQL Query:

SQL SELECT *
FROM DB."Table_Name" WHERE SYNC_DATE = '05/04/2011 00:08:13'

error:

ErrorSource: OraOLEDB, ErrorMsg: ORA-01861: literal does not match format string
SQL SELECT *
FROM DB."Table_Name" WHERE SYNC_DATE = '05/04/2011 00:08:13'

Any body know why, it worked before in QV 9, after switch desktop to 10 I got this error.

thanks

Michiel

Labels (1)
1 Solution

Accepted Solutions
Not applicable
Author

Hi,

I got a similar problem few days ago.

Try using oracle TO_DATE function in WHERE clause. In my case it helped:).

SQL SELECT *

FROM CC."RP_RAWDATA_HEADER" WHERE SYNC_DATE = TO_DATE('05/04/2011 00:08:13','MM/DD/YYYY hh:mm:ss')

Tomas

View solution in original post

3 Replies
Not applicable
Author

Hi,

I got a similar problem few days ago.

Try using oracle TO_DATE function in WHERE clause. In my case it helped:).

SQL SELECT *

FROM CC."RP_RAWDATA_HEADER" WHERE SYNC_DATE = TO_DATE('05/04/2011 00:08:13','MM/DD/YYYY hh:mm:ss')

Tomas

Not applicable
Author

Hi,

It's the sollution for sure but the format string needed a small modification:

Final working string is:

'DD/MM/YYYY hh24:mi:ss'

Thanks!

Michiel



Not applicable
Author

It depends on what datetime format is specified in table definition.

I`m glad it helped.

Regards

Tomas