Crystal Report for VS2010中的TO_DATE函数问题 [英] Oracle TO_DATE function issue in Crystal Report for VS2010

查看:340
本文介绍了Crystal Report for VS2010中的TO_DATE函数问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Crystal Report VS2010命令文本中运行以下查询时遇到问题。它在Oracle 10g中运行良好。

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')

我尝试过使用BETWEEN函数,但我得到了同样的错误信息:

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

我认为它与 TO_DATE 函数有关?

推荐答案

我要在这里做一个猜测,并断言错误出现,因为你的代码块('dd / mm / yyyy')中指定的日期格式不完全匹配您的数据库中指定的。

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.

换句话说,如果Oracle期望日期格式为'DD-MON-YY'因为您使用的函数为TO_DATE(some_date,'dd / mm / yyyy'),您会看到此错误。 非数字值将是月份名称。

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.

这篇关于Crystal Report for VS2010中的TO_DATE函数问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆