Oracle BI Publisher - 按即将到期的日期报告
Oracle BI Publisher - Reporting by Upcoming Expiration Date
我正在尝试在我的查询中集成一个脚本,该脚本将从 END_DATE 列中 return 仅在接下来的 30 天内到期的行。这是我的查询:
select "SITE"."NAME" as "NAME",
"CONTRACT_TYPE"."NAME" as "NAME_1",
"CONTRACT"."END_DATE" as "END_DATE"
from "DB"."SITE" "SITE",
"DB"."CONTRACT" "CONTRACT",
"DB"."CONTRACT_TYPE" "CONTRACT_TYPE"
where "CONTRACT"."CONTRACT_TYPE_ID"="CONTRACT_TYPE"."ID"
and "CONTRACT"."SITE_ID"="SITE"."ID";
这是当前输出:
NAME NAME_1 END_DATE
---------- -------- ----------
Customer_1 Contract 11-NOV-17
Customer_2 Contract 13-OCT-17
Customer_3 Contract 02-DEC-17
Customer_4 Contract 15-JAN-18
我只想显示将在 30 天内过期的 END_DATE。
如有任何帮助,我们将不胜感激。
试试这个。
select "SITE"."NAME" as "NAME",
"CONTRACT_TYPE"."NAME" as "NAME_1",
"CONTRACT"."END_DATE" as "END_DATE"
from "DB"."SITE" "SITE",
"DB"."CONTRACT" "CONTRACT",
"DB"."CONTRACT_TYPE" "CONTRACT_TYPE"
where "CONTRACT"."CONTRACT_TYPE_ID"="CONTRACT_TYPE"."ID"
and "CONTRACT"."SITE_ID"="SITE"."ID"
and "CONTRACT"."END_DATE" <= sysdate + 30;
我正在尝试在我的查询中集成一个脚本,该脚本将从 END_DATE 列中 return 仅在接下来的 30 天内到期的行。这是我的查询:
select "SITE"."NAME" as "NAME",
"CONTRACT_TYPE"."NAME" as "NAME_1",
"CONTRACT"."END_DATE" as "END_DATE"
from "DB"."SITE" "SITE",
"DB"."CONTRACT" "CONTRACT",
"DB"."CONTRACT_TYPE" "CONTRACT_TYPE"
where "CONTRACT"."CONTRACT_TYPE_ID"="CONTRACT_TYPE"."ID"
and "CONTRACT"."SITE_ID"="SITE"."ID";
这是当前输出:
NAME NAME_1 END_DATE
---------- -------- ----------
Customer_1 Contract 11-NOV-17
Customer_2 Contract 13-OCT-17
Customer_3 Contract 02-DEC-17
Customer_4 Contract 15-JAN-18
我只想显示将在 30 天内过期的 END_DATE。
如有任何帮助,我们将不胜感激。
试试这个。
select "SITE"."NAME" as "NAME",
"CONTRACT_TYPE"."NAME" as "NAME_1",
"CONTRACT"."END_DATE" as "END_DATE"
from "DB"."SITE" "SITE",
"DB"."CONTRACT" "CONTRACT",
"DB"."CONTRACT_TYPE" "CONTRACT_TYPE"
where "CONTRACT"."CONTRACT_TYPE_ID"="CONTRACT_TYPE"."ID"
and "CONTRACT"."SITE_ID"="SITE"."ID"
and "CONTRACT"."END_DATE" <= sysdate + 30;