Oracle TO_DATE function issue in Crystal Report for VS2010

时光总嘲笑我的痴心妄想 提交于 2019-12-12 05:57:08

问题


I am having problem running following query in Crystal Report VS2010 command text. It runs fine in Oracle 10g.

SELECT *
FROM tbl_ts
WHERE PROJECTCODE = 2274
AND LOGDATE >= TO_DATE('01/08/2011','dd/mm/yyyy')
AND LOGDATE <= TO_DATE('31/08/2011','dd/mm/yyyy')

I have tried using BETWEEN function but i am getting this same error message:

I think its something to do with TO_DATE function?


回答1:


I'm gonna make a guess here and assert that the error arises because the date format you specified in your code block ('dd/mm/yyyy') does not exactly match what is specified in your database.

In other words, if Oracle is expecting the date in a standard format of 'DD-MON-YY' since you are using the function as TO_DATE(some_date, 'dd/mm/yyyy') you are seeing this error. The "non-numeric" value would be the month name.



来源:https://stackoverflow.com/questions/11968009/oracle-to-date-function-issue-in-crystal-report-for-vs2010

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!