首页 > 解决方案 > Oracle Reports (6i): Get difference of two items from two different queries (Multi Query Report)

问题描述

I have an Oracle 6i report with Two Complex Queries (Q1 and Q2) connected by Data Link. The report was developed by some other developer who is not available now. Multiple columns are being displayed in report.

Q1 has a column Total_Issuance and Q2 has a column Total_Consumption. I have to display their difference on report. I am using a formula column to get the difference and then binding a display field to this formula column to show on report.

But since the formula column is outside both the queries, I am getting following errors.

REP-1517: Coloumn 'CF_1' references column 'Total_Issuance', which has incompatible frequency.

REP-1517: Coloumn 'CF_1' references column 'Total_Consumption', which has incompatible frequency.

标签: oracleplsqloraclereports

解决方案


为查询创建一个新的计算字段,即详细查询(我假设它是 Q2)。在这个计算字段中,您可以简单地使用:

return :Total_Issuance - :Total_Consumption;

来计算差异。


推荐阅读