Jump to content

BIRT Developer Center Download

* * * * * 1 votes

Automatically show only data from today at 8:30pm to tomorrow at 7:00am.

  • Please log in to reply
4 replies to this topic

#1 raineyt



  • Members
  • PipPip
  • 14 posts

Posted 13 July 2017 - 11:02 AM

I'm having a really hard time trying to figure this one out. 


I currently have a report that, when run, will show a worker's schedule for today. I have a parameter that sets the schedule_date equal to BirtDateTime.now()


I have a team of night shift workers who need to see their schedule, which runs from 8:30pm to 7:00am the next day. They encounter problems with the current report, because it only shows them part of their schedule. Before or after midnight, depending on when they run it. 



Lets say they run the report at 9:00pm on Monday night, then again on Tuesday morning at 3:00am. It needs to show the exact same schedule at both of those run times. 

  • murielyb60 likes this

#2 jfranken


    Advanced Member

  • Members
  • PipPipPip
  • 97 posts

Posted 13 July 2017 - 01:16 PM

The night shift workers' schedules span two days, therefore you need a start date and an end date.  For the day shift, the start date and end date will always equal today.  For the night shift, if the report is run before midnight, the start date will be today and the end date will be BirtDateTime.addDay(BirtDateTime.today(), 1).  The formula simply adds one day.  If the report is run after midnight, the start date will be BirtDateTime.addDay(BirtDateTime.today(), -1).  The formula subtracts one day.  The end date will be today.




Jeff F.


Customer Support Engineer I

Website: www.opentext.com






#3 Matthew L.

Matthew L.

    Senior Member

  • BIRT Experts
  • 290 posts

Posted 17 July 2017 - 08:59 AM



Is your schedule data for the report pulling from a database, Excel, CSV, other?

Also, would you happen to have some sample data (or sample report) you could upload so that we can try and build an example out of?

Matthew L.
Actuate is now OpenText

#4 raineyt



  • Members
  • PipPip
  • 14 posts

Posted 23 August 2017 - 04:42 AM

It's pulling from a database. 
I can post what I have so far. How do I upload the report I've created to my comment?

#5 shamo


    Senior Member

  • Members
  • 190 posts

Posted 23 August 2017 - 06:20 AM

Create two parameters with default start date and an end date. start date should be something like BirtDateTime.addHour(BirtDateTime.Today(),20.30) and end date something like BirtDateTime.addHour(BirtDateTime.Today,31) and select Hidden


Birt.Today() starts at 12:00 AM so in essence you add 20hrs 30mins to get 8:30 and 31 to get you the next date 7Am. This is dependant on when you run the report so you may have to subtract instead od adding.


Hope it helps