Jump to content
Changes to the Jaspersoft community edition download ×

Calculate Date Difference Excluding Weekends

L Kark

Recommended Posts

Hello. I am trying to create a field in my report which counts the amount of days between two dates excluding any weekends. Would someone have experience with this who can guide me as to the best way to go about this? Perhaps, the best would be to do the calculation in the query itself. If so, how would I figure out which days are weekends in the date range, so I can subtract those days from my final count of days between the start and end date. I am querying using Oracle DB.

Thank you!

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

As you said Query would be the best option if you want to count the minutes and seconds diff as per your requirement

Jasper has built in functions. I believe it would be useful to consider in this case. 

NETWORKDAYS(new Date(),new SimpleDateFormat("mm/dd/yyyy").parse("07/01/2018")) 

Link to comment
Share on other sites

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...