Hello,
I have two timestamp fields $F{STARTDATE} and $F{ENDDATE}. When I run the report, they both look like this: 2024-01-22, 11:00 a.m.
For these two fields, I only need the time so the expression behind both fields is: new SimpleDateFormat("hh:mm a").format($F{STARTDATE}) and new SimpleDateFormat("hh:mm a").format($F{ENDDATE}). This gets only the time, so it displays 11:00 am.
Now I have another variable called $V{duration} which needs to get the amount of time between the end date and start date fields which are timestamps. So, it would be $F{STARTDATE} - $F{ENDDATE}. I can't figure out how to do this no matter how I tried.
How can I calculate the difference and then convert it into days because the output should look like 1.5 + "days".
I'm using Jaspersoft® Studio 6.20.6 - Visual Designer for JasperReports 6.20.6.
Thank you in advance.
R