Crystal 报表公式

Crystal Report Formula

在开始之前,我是写公式的初学者。

我正在 Crystal 报告中编写字段公式,基本上是:

FIELD-1000000

我希望该字段减去 1000000,除非该字段为 0

如何添加 "unless the field is 0"

您的公式应该如下所示

if {FIELD} <> 0 then {FIELD}-1000000

如果您需要在特定情况下计算其他内容(例如然后值 *2),则公式类似于

if {FIELD} <> 0 then {FIELD}-1000000
else {FIELD}*2

解释:CR 中的 <> 0 表示除 0

之外的任何其他值

希望对您有所帮助

为了检查数值是否不等于,请使用“<>”。例如

if(field<>0) then your logic