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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

to_date in qlikview

Hello everyone,

I would like to place on question.

I want to make a query on a oracle database with qlikview, but I have an error.

An example of what I am trying to do is this:

SELECT todate(sysdate,'DD-MM-YYYY') as "data" from dual;

This returns the error on the image attached.

date_Error.png

*Error translation: the literal does not correspond to the character chain if the format SELECT...

If I run the line SELECT todate(sysdate) as "data" from dual; it works without a problem.

EDIT: I forgot to say that if I run the statement on sql developer it works...

Any ideas?

Thanks in advance!

1 Solution

Accepted Solutions
aveeeeeee7en
Specialist III
Specialist III

Hi Ivo

Use To_Char instead of ToDate

SELECT to_char(sysdate,'MM/DD/YYYY') as "data" from dual;

Regards
Aviral Nag

View solution in original post

5 Replies
vardhancse
Specialist III
Specialist III

The default date format might be SET DateFormat='MM/DD/YYYY';

Try to change and re run the script

Not applicable
Author

With this line

SELECT todate(sysdate,'MM/DD/YYYY') as "data" from dual;

I get a new error: Not a valid month, probably because today is the 21st and on where is MM should be the value of the day...

But the formatting of the date should overwrite this...

I forgot to say on the top post that if I run the statement on sql developer it works...

aveeeeeee7en
Specialist III
Specialist III

Hi Ivo

Use To_Char instead of ToDate

SELECT to_char(sysdate,'MM/DD/YYYY') as "data" from dual;

Regards
Aviral Nag

ashfaq_haseeb
Champion III
Champion III

HI,

After making connecting string with Oracle database.

try below

SQL SELECT todate(sysdate,'DD-MM-YYYY') as "data" from dual;



Regards

ASHFAQ


Not applicable
Author

It works with to_char.

Thanks!!