• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Best Solution for Presenting Data

 
Ranch Hand
Posts: 2211
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a remote table of data that has a job number, start date, finish date, and hours scheduled to be spent. I have a report that shows job number as rows and 12 months as columns. What is the best way to iterate through the table data, break the time between start date and finish date into months, apply a value of hours(hours scheduled divided by number of months) for each of those months so this data can be shown in my report?
 
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

hours scheduled divided by number of months



Is your report really that simple? What if the start date is on the last day of the month? Are you going to allocate the same number of hours for that month as all the others? What about allowing for weekends and (shudder) holidays?

I hate to answer a question with more questions so I will close by offering a few hints. You'd probably have a more accurate report if you step through each date in your range and decide if that's a valid work day. You can do this with Java's Date class, or even better with the Calendar class. Either of those will allow you to check the month, so you can add each work day to a monthly total.
 
Steve Dyke
Ranch Hand
Posts: 2211
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The portion of the report I am working on is to show projected hours by level loading a month matrix. Before I start I set any start dates to the first day of the month. The portion of the report that shows actual project scheduled hours is more like you suggested by alotting for weekends and holidays and actually calculates per day.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic