简体   繁体   English

Crystal Reports 13:尝试通过公式(Oracle数据库)从报告中获取过去8个月的数据

[英]Crystal Reports 13: Trying to grab past 8 months data from report via Formula (Oracle database)

I have a report that asks for a start date and end date, grabs the Data from our ERP system(Oracle) and then outputs the data according to those date parameters. 我有一个报告要求开始日期和结束日期,从我们的ERP系统(Oracle)中获取数据,然后根据这些日期参数输出数据。 I want to remove the parameters and hardcode a formula that shows past 8 months data. 我想删除参数并硬编码显示过去8个月数据的公式。 The Crystal Reports table has only one date field I and use called: Date ({TR_BATCH.TIME_STAMP}) I believe I can add a statement to that to show only past 8 months data and save the report as the Past_8_Months report. Crystal Reports表只有一个日期字段I并且使用名为:Date({TR_BATCH.TIME_STAMP})我相信我可以添加一个语句来显示过去8个月的数据,并将报告保存为Past_8_Months报告。 However, I'm not sure how to code that in. I'm sure it's a fairly simple statement, but I've only worked mostly with select expert and filters within Crystal. 但是,我不确定如何编写代码。我确定这是一个相当简单的陈述,但我只使用Crystal中的select expert和过滤器。 Thanks! 谢谢!

I tried using the Select Expert Record , in period xxxx but it doesn't show period of past 8 months. 我尝试使用选择专家记录,期间为xxxx,但它没有显示过去8个月的期间。

Date ({TR_BATCH.TIME_STAMP}) 日期({TR_BATCH.TIME_STAMP})

No results because I'm unsure of the correct code to use. 没有结果,因为我不确定要使用的代码是否正确。

IDK how your query is defined in sql reports, the following clause will subtract 8 months from the current date ( or replace sysdate with some other report date parameter). IDK如何在sql报告中定义查询,以下子句将从当前日期减去8个月(或将sysdate替换为其他报告日期参数)。

select stuff....
from ... stuff...
where ...  add_months(trunc(sysdate,'mm'),-8)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM