Crystal reports 你能像在access查询中一样设置字段计数吗?

Crystal reports 你能像在access查询中一样设置字段计数吗?,crystal-reports,Crystal Reports,这就是我如何计算Access中名为TotalCompleted的字段的方法 TotalCompleted: IIf([dod] Between forms!frmMonthlyReports!BeginningDate And forms!frmMonthlyReports!EndingDate And ([DischargeInformation] Like "completed*" Or [DischgInfo] Like "completed*"),1,0) 然后我数一数,得到我

这就是我如何计算Access中名为TotalCompleted的字段的方法

TotalCompleted: IIf([dod] Between forms!frmMonthlyReports!BeginningDate And 
forms!frmMonthlyReports!EndingDate 
And ([DischargeInformation] Like "completed*" 
Or [DischgInfo] Like "completed*"),1,0) 
然后我数一数,得到我的总数


我可以在Crystal Reports中这样做吗?你能给我举个例子吗?

你确实可以。沿以下行创建新公式:

if {yourtable.dod} in {?FromData} to {?ToDate} and {yourtable.dischargeinformation} LIKE 'completed*' then
 1
else if {yourtable.dischginfo} LIKE 'completed*' then
 1
else
 0

为什么不编写SQL来实现这一点,然后在报表上显示值呢?+1您可能应该提到,您需要插入一个公式的总和来获得总数。