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

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. 


Comments

  • 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

     

     

     

  • 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

  • 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?


  • 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


Sign In or Register to comment.