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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
master_student
Creator III
Creator III

OraOLEDB, ErrorMsg: ORA-01861: literal does not match format string

Hello community,

I need to get the result of a query; Date today.

The date field format is 063016. here's my query :

SELECT ....

FROM

WHERE

tt.STARTOFCHARGINGDATE = TO_DATE (TO_CHAR (SYSDATE , 'MMDDYY'), 'MMDDYY')

It didn't work; Error : OraOLEDB, ErrorMsg: ORA-01861: literal does not match format string

Any idea please?

Thanks

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

STARTOFCHARGINGDATE is a varchar, i.e. text. Your comparing a text value with a date value. Perhaps this works:


SELECT ....

FROM

WHERE

tt.STARTOFCHARGINGDATE = TO_CHAR (SYSDATE , 'MMDDYY')


talk is cheap, supply exceeds demand

View solution in original post

3 Replies
master_student
Creator III
Creator III
Author

for your info, the data type of the stratofcharging field is varchar. see bellow :

Capture.PNG

Thanks in advance.

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

STARTOFCHARGINGDATE is a varchar, i.e. text. Your comparing a text value with a date value. Perhaps this works:


SELECT ....

FROM

WHERE

tt.STARTOFCHARGINGDATE = TO_CHAR (SYSDATE , 'MMDDYY')


talk is cheap, supply exceeds demand
ejvanmastrigt
Partner - Contributor II
Partner - Contributor II

TO_DATE() converts your string to a date.

Since the data type of STARTOFCHARGINGDATE is VARCHAR2, using function TO_CHAR should do it:

WHERE STARTOFCHARGINGDATE = TO_CHAR(SYSDATE, 'MMDDYY')

Best regards,

Erik