sszretter Posted June 18, 2011 Share Posted June 18, 2011 In JasperReports (iReport), how can I take a date field from the database and calculate the difference between that and the current date (for example to calculate age) and then GROUP the report on that value (age 18 group, age 19 group/break, etc.)?date field in iReport:$F{dob}[/code]example of how I calculate the age - at least to display it on the report, but I want to break on this value somehow:<![CDATA[theDate=new Date($F{dob}); currentDate=new Date(); Math.round((currentDate.getTime()-theDate.getTime())/1000/60/60/24/356)]]>[/code]Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now