水晶报表传递时间参数报错的解决方案

报错信息如下:

此处需要一个日期时间
公式<Record_Selection>
'{DayStatement.日期}='2008-09-05''
此处需要一个日期时间

解决方案:

我把myreport.RecordSelectionFormula = "{DayStatement.日期} = '" + DTP1.Value + "'"
换成myreport.RecordSelectionFormula = "{DayStatement.日期} = # 2008-09-05 #"
就可以查询

自己也遇到这个问题,找了好久才找到。做个记录。

原文地址:https://www.cnblogs.com/zjBoy/p/2633192.html