问题
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