如何比较水晶报告中两个日期的月份

时间:2015-09-21 17:58:08

标签: date crystal-reports

我的水晶报告上有七个日期。我需要将每个日期的月份与报告的运行日期进行比较(@Datebeg是报告日期的字段)。 我在报告中使用公式

    if month({Date1})=month(cdate({@Datebeg})) and 
month({Date2})=month(cdate({@Datebeg})) and 
month({Date3})=month(cdate({@Datebeg})) and 
month({Date4})=month(cdate({@Datebeg})) and 
month({Date5})=month(cdate({@Datebeg})) and 
month({Date6})=month(cdate({@Datebeg})) and
month({Date7})=month(cdate({@Datebeg}))
then (H1+H2+H3+H4+H5+H6+H7) else 1.

我得到的输出是1,每次。几个月都没有得到比较。如果我把OR而不是AND,这给了我所有H(1..7)的总和。 请帮我比较。

提前致谢。

0 个答案:

没有答案
相关问题