Filter Data on max(date)


In the Jasper Report Server I try to read data from a table that is periodically filled from a "master" db via an etl job. The job simply copies all rows and does not check for duplicate entries. Therefore I have lots of entries that only differ in the timestamp-field "etl_date". In SQL in can simply filter on the rows copied during the last etl_job with

where etl_date=(select max(etl_date) from dwh_contract)

Is there a way to do the same inside Jasper Reports? It is not possible to modify the etl_job and i don't want to create a view in the database.

Best Regards Andi

andreas.falk's picture
Joined: Jul 9 2019 - 6:52am
Last seen: 1 year 4 weeks ago

1 Answer:


Why shouldn't it work inside the report query? Is your "dwh_contract" table not visible for the given report connection or what makes you doubt it?

If it doesn't work, just pass the latest ETL_DATE as hidden Date-Parameter also to your report and filter it out in your report query like:

... WHERE etl_date = $P{LatestETLDatePassedFromOutside}

hth + regards


C-Box's picture
Joined: Jul 19 2006 - 5:58pm
Last seen: 2 weeks 2 days ago