4Manuals

  • PDF Cloud HOME

五月份报表设计器中某月的天数 Download

    如果连接断开或超时或服务器关闭,是否选择更新锁定释放? Oracle 12c全文索引维护 oracle过程创建并运行ora-00900错误 如何通过Oracle Table知道应用程序名称 查询以从表中选择具有特定列值的记录 将数据从Kafka导出到Oracle 加载数据需要花费很多时间 缓存中的Oracle Reports Service文件名(Desname) REGEXP_SUBSTR Oracle |提取两个定界符之间的字符串 Oracle 19c无法创建主密钥

我正在使用Pentaho Report Designer版本:7.0.0.0-25。 我想显示某个月的所有日子。但是,月和年是参数,即月和年是动态选择的。我想显示选定月份的所有日期 请建议我在oracle或Pentaho报表设计器中的脚本中查询。

1 个答案:

答案 0 :(得分:0)

分层查询有帮助。

只需设置默认日期格式;您不必这样做:

SQL> alter session set nls_date_format = 'dd.mm.yyyy';

Session altered.

这就是您需要的:输入参数是

  • 月(par_month)
  • 年(par_year)

将月份转换为两位数的值(使用LPAD函数),以便TO_DATE的格式掩码正常工作。

SQL> with test (start_date) as
  2    (select to_date(lpad(&par_month, 2, '0') || &par_year, 'mmyyyy')
  3     from dual
  4    )
  5  select start_date + level - 1 datum
  6  from test
  7  connect by level <= to_number(to_char(last_day(start_date), 'dd'));
Enter value for par_month: 2
Enter value for par_year: 2019
old   2:   (select to_date(lpad(&par_month, 2, '0') || &par_year, 'mmyyyy')
new   2:   (select to_date(lpad(2, 2, '0') || 2019, 'mmyyyy')

DATUM
----------
01.02.2019
02.02.2019
03.02.2019
04.02.2019
05.02.2019
06.02.2019
07.02.2019
08.02.2019
09.02.2019
10.02.2019
11.02.2019
12.02.2019
13.02.2019
14.02.2019
15.02.2019
16.02.2019
17.02.2019
18.02.2019
19.02.2019
20.02.2019
21.02.2019
22.02.2019
23.02.2019
24.02.2019
25.02.2019
26.02.2019
27.02.2019
28.02.2019

28 rows selected.

SQL>



Similar searches
    如何从Firestore数据库返回值? OpenUI5示例应用程序遇到跨域读取阻止问题 使用tomcat调用JavaBridge时获取404 如何在正面呈现WordPress Gutenberg中的所有已注册块? 运价表费率在显示Magento2.3的多个地址交付金额上不起作用的问题