How to compare dates in iReport?

2019-08-31 05:58发布

How to compare dates in iReport ? I want to use the "Print When Expression.."

Something like : $F{date_from_table} <= $F{another_date_from_table} ? true : false

It should work .

What is the correct syntax? Thanks.

1条回答
何必那么认真
2楼-- · 2019-08-31 06:32

Try to use Date.before() or Date.after() method.
Like below

($F{date_from_table}.before($F{another_date_from_table}) || $F{date_from_table}.equals($F{another_date_from_table})) ? true : false
查看更多
登录 后发表回答