Crystal使用命令向Oracle数据库报告参数 [英] Crystal reports parameters using a command to an Oracle database

查看:49
本文介绍了Crystal使用命令向Oracle数据库报告参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Crystal Reports 2008中的命令创建一个具有三个可选参数的报告.我无法使用的唯一一个参数是date参数(似乎Oracle不将日期与SQL Server一样对待)

I am trying to create a report that has three optional parameters using a command in Crystal Reports 2008. The only one I can't get to work is the date parameter (seems Oracle does not treat dates the same as SQL Server).

我希望用户能够选择他们想要使用的参数;一,二或三.当我在TOAD中运行它并对日期进行硬编码时,它可以很好地工作,但使用语法创建参数的Crystal报表将无法运行它.

I want the user to be able to pick and choose which parameter they would like to use; one, two, or all three. It works beautifully when I run it in TOAD and hard code the dates, but it will not run in Crystal reports using the syntax to create the parameters.

我已经在SQL Server环境中完成了一千次,但是无法使其在Oracle中工作.

I have done this a thousand times in a SQL server environment but can't get it to work in Oracle.

Oracle表中的字段类型为 DATE .

The field is type is DATE in the Oracle table.

这是我的Report命令中3个参数的语法:

Here is the syntax from my Report command for the 3 parameters:

AND ( ( CLIL. ITEM_TAG IN ('{?tag}') OR CLS.DESCRIPTION IN( '{?desc}')
OR trunc (CLIL.ISSUE_DATE) BETWEEN to_date ('{?StartDate}', 'mm/dd/yyyy') and to_date ('{?EndDate}', 'mm/dd/yyyy' )))

推荐答案

Crystal报表不接受 Oracle 语法..您需要使用CR提供的功能来处理日期...然后在CR中使用它.

Crystal reports doesn't accept the Oracle syntax.. you need to use the functions provided by the CR to do manuplations of dates... and then use that in CR.

在CR中创建一个开始日期结束日期作为日期参数,然后使用它们.

Create a Start Date and End Date as date parameters in CR and then use those.

(CLIL.ISSUE_DATE) >= {?StartDate} and (CLIL.ISSUE_DATE) < {?EndDate}

此处的开始日期和结束日期是 Date 数据类型参数.

Here start date and end date are Date datatype parameters.

如果(CLIL.ISSUE_DATE)是日期时间参数,则使用晶体提供的函数 Cdate .

if (CLIL.ISSUE_DATE) is a datetime parameter then use the function Cdate provided by the crystal.

这篇关于Crystal使用命令向Oracle数据库报告参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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