Jump to content

BIRT Developer Center Download


Photo
- - - - -

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


  • Please log in to reply
2 replies to this topic

#1 raineyt

raineyt

    Member

  • Members
  • PipPip
  • 13 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. 



#2 jfranken

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.

 

Regards,

Jeff


Jeff F.

 

Customer Support Engineer I

Website: www.opentext.com

 

emailsupport-logo-opentext.gif

 

 

 


#3 Matthew L.

Matthew L.

    Senior Member

  • BIRT Experts
  • 281 posts

Posted 17 July 2017 - 08:59 AM

raineyt,

 

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
http://www.actuate.com