我有一个报告,其中我需要筛选出在同一站点内存在重复的合同号但日期不同的记录。由于日期不同,它不会被认为是重复值。然后我需要汇总成本并计算合同,但即使我取消“重复字段”,它也会汇总价值。我想选择日期最新的记录。
Station Trans-DT Cost Contract-No
8 5/11/2010 10 5008
8 5/12/2010 15 5008
9 5/11/2010 12 5012
9 5/15/2010 50 5012发布于 2010-05-21 05:20:09
类似于:基于新创建的Contract-No Maximum ({Trans-DT}, {Command.Contract-No})
编辑:
要汇总成本和计算合同,您需要一些技巧。
将以下内容(在公式字段中)添加到报告标题部分:
// start the sum
// put in report header
WhilePrintingRecords;
Global NumberVar TotalCost := 0;报告页脚中包含以下内容:
// final count
// put in report footer
WhilePrintingRecords;
Global NumberVar TotalCost;
TotalCost;并将其放入您的Contract-No或Station组中的公式字段中:
WhilePrintingRecords;
Global NumberVar TotalCost;
if {Command.Trans-DT} = maximum({Command.Trans-DT}, {Command.Contract-No}) then
TotalCost := TotalCost + {Command.Cost}
else
TotalCost;我会把计算的部分留给你。祝好运!
https://stackoverflow.com/questions/2877719
复制相似问题