【发布时间】:2017-01-19 08:16:59
【问题描述】:
早安,
我在 Crystal 子报告中有以下公式,但它没有返回任何值。我知道存在十多个记录的数据,我使用了检查功能并且没有给出语法错误,并且我遵循了以下问题“Crystal Report: How to evaluate multiple IF statements in one formula?”中给出的示例。
公式如下;
(if {?Pm-Enquiry.EnquiryId} <1000 and
{DocumentType.DocumentSubtype} = "DocumentSubtype1" then
left ({DocumentSubtype1Table.Field1},3) else
left ({DocumentSubtype1Table.Field1},4)
);
(if {?Pm-Enquiry.EnquiryId} <1000 and
{DocumentType.DocumentSubtype} = "DocumentSubtype2" then
left ({DocumentSubtype2Table.Field1},3) else
left ({DocumentSubtype2Table.Field1},4)
);
(if {?Pm-Enquiry.EnquiryId} <1000 and
{DocumentType.DocumentSubtype} = "DocumentSubtype1" then
left ({DocumentSubtype3Table.Field1},3) else
left ({DocumentSubtype3Table.Field1},4)
);
公式应确定 ID 是小于还是大于三位,并从 DocumentSubtypeTable 中检索前 3/4 位。不幸的是,ID 已与该字段中的日期合并,因此必须使用此公式。
如果你们能提供任何帮助,我们将不胜感激。
【问题讨论】:
-
那是您创建的公式吗?你想做什么?
-
这是我修改后的公式。基本上,每个文档子类型中都有一个字段,例如“1992 12/01/2016”或“123 01/01/2017”。我只希望公式根据查询 ID 的长度返回该字段的前 4 或 3 位数字。
-
显示一个给定的例子和一个给定的结果。
标签: if-statement crystal-reports formula