开发者

The result of selection formula must be a boolean in Crystal Report

开发者 https://www.devze.com 2023-04-03 08:46 出处:网络
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.

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_tlmytvResu开发者_StackOverflow社区lt.ngaydk};
Date (Val (dt[1 to 4]),Val(dt[5 to 6]) ,Val(dt[7 to 8]))

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


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.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号