选择公式的结果必须是Crystal报表中的布尔值 [英] The result of selection formula must be a boolean in Crystal Report

查看:550
本文介绍了选择公式的结果必须是Crystal报表中的布尔值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在水晶报表中将字符串转换为datetime,我使用日期(YYYY,MM,DD)和CDate(YYYY,MM,DD)像提示,但有错误:选择公式的结果必须是布尔值。

I want to convert string to datetime in crystal report, I used Date(YYYY,MM,DD) and CDate(YYYY,MM,DD) like a tip but have error: The result of selection formula must be a boolean.

stringVar dt := {Control_pmt_tlmytvResult.ngaydk};
Date (Val (dt[1 to 4]),Val(dt[5 to 6]) ,Val(dt[7 to 8]))

Control_pmt_tlmytvResult格式化字符串:YYYY-MM-DD HH:mm:ss

Control_pmt_tlmytvResult is formatted string: YYYY-MM-DD HH:mm:ss

推荐答案

您尝试在选择公式中返回日期(无论是记录,组还是已保存的数据选择公式),并且CR不知道如何处理这种情况。它必须是一个布尔值,因为选择公式基本上会告诉报表只包括公式计算结果为TRUE的数据。

You're attempting to return a date in a selection formula (Whether it is a Record, Group, or Saved Data selection formula) and CR doesn't know how to handle that situation. It must be a boolean because selection formulas essentially tell the report to only include data where the formula evaluates to TRUE.

这就像询问:你想要什么比萨?并得到答复12月7日! Crystal Reports正在询问您要在报告中包含哪些数据(通过选择公式),并且您正在回复12月7日。如果您希望该日期作为选择条件有用,您必须通过布尔语句如 {transactions.date} dt 。现在,报表将包括您刚刚计算日期之前的所有交易。

This is like asking, "What do you want on your pizza?" and getting the response "December 7th!" Crystal Reports is asking what data you want to include in the report (via selection formula) and you're responding "December 7th". If you want that date to be useful as selection criteria, you have to use it via a boolean statement like {transactions.date} < dt. Now the report would include all transactions prior to the date you have just computed.

这篇关于选择公式的结果必须是Crystal报表中的布尔值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆