Jump to content
We've recently updated our Privacy Statement, available here ×

khidesre

Members
  • Posts

    1
  • Joined

  • Last visited

khidesre's Achievements

Newbie

Newbie (1/14)

  • Conversation Starter Rare
  • Week One Done
  • One Month Later

Recent Badges

0

Reputation

  1. 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
×
×
  • Create New...