Jump to content
Changes to the Jaspersoft community edition download ×

How to calc average days from two java.util.Date?


mxc

Recommended Posts

Hi all,

 

 

In my report I need to show the average number of days beween the time the issue was logged and the time it was resolved. From the database I get two java.util.Date fields. I have created a variable $avg_days.

 

I have tried something like this with the average calculation but since setTime returns void it doesn't work.

Code:
(new java.util.Calendar().setTime($F{date_accepted}).getTimeinMillis() - new java.util.Calendar().setTime($F{date_logged}).getTimeinMillis())/86400

 

 

Does anyone else have an idea how to do this?

Link to comment
Share on other sites

  • 2 weeks later...
  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...