Results 1 to 7 of 7
  1. #1
    airwitte is offline Novice
    Windows XP Access 2003
    Join Date
    Dec 2010
    Posts
    3

    Projecting project completion dates using # of hours

    Don't know if this is possible in Access, but here goes:



    I am trying to develop a database that will allow our warehouse to enter an order we receive from a customer and enter the estimated # of hours it will take to complete the work. The warehouse staff will also enter a start date and time into the record.

    So, here is an example: Warehouse enters a record into Access for Customer A. They enter a startDate/time of 12/2/10 at 3pm (basically, the day/time it was received by us), and then they enter how many hours they THINK the project will take (let's assume 43 hours to complete this order). I need to have Access figure out the date that the project is estimated to complete. Keep in mind, I need to exclude company holiday dates, and count # of hours the warehouse works every day. Weekdays are 10 hours a day, Saturdays are 5, and Sundays are 0.
    Last edited by airwitte; 12-02-2010 at 11:50 AM. Reason: Forgot an important point

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    check out DATEDIFF(). also check out the 'EDATEDIFF()' functions here: http://www.ajenterprisesonline.com/_functions/ (for holiday exclusion possibilities).

    the easiest answer to this would start with a variation of datediff() using days, and multiplying the result by 10.

  3. #3
    William McKinley is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jul 2010
    Posts
    59
    Wouldn't DateAdd() work well for this?

  4. #4
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    Quote Originally Posted by William McKinley View Post
    Wouldn't DateAdd() work well for this?
    Very good. Looked right past it. thank you William.

  5. #5
    airwitte is offline Novice
    Windows XP Access 2003
    Join Date
    Dec 2010
    Posts
    3
    Quote Originally Posted by ajetrumpet View Post
    Very good. Looked right past it. thank you William.
    How would that help? I have only one date/time (startdate/time), and I don't know when the end date is. And I still need to account for weekend days having different hours from weekdays...

  6. #6
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    Quote Originally Posted by airwitte View Post
    How would that help? I have only one date/time (startdate/time), and I don't know when the end date is. And I still need to account for weekend days having different hours from weekdays...
    this is custom, airwitte. You cannot do this whole task with built-in functions by Access. It's not possible.

    example though - if the project starts today, and the user thinks it takes 40 hours to complete, the simple answer for an end date would be:
    Code:
    dateadd("h", 40, date())
    but, as you said, there are variations, so you have to write code to cover the possibilites, and combine that code with the dateadd() function, as above, to make it work. Understand?

    the page I gave you earlier can be used as a starting point, as the exclusions you're looking for are demonstrated quite clearly there.

  7. #7
    William McKinley is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jul 2010
    Posts
    59
    Not sure if you figured this out yet, but I took a shot at it. My function might be a little bit(or extremely) excessive, but I need some practice so what the heck. I didn't get around to adding in whether it discerns between weekdays/weekends, but it might get something going.

    It assumes an 8:00AM-6:00PM Work day.

    Code:
    Expr1: IIf(([ProcessTime]+Hour([StartDate]))<=18,DateAdd("h",[ProcessTime],[StartDate]),DateAdd("h",8+(((([ProcessTime]-(18-Hour([StartDate])))/10)-Int(([ProcessTime]-(18-Hour([StartDate])))/10))*10),DateAdd("d",1+(Int(([ProcessTime]-(18-Hour([StartDate])))/10)),DateAdd("h",-1*(DatePart("h",[StartDate])),[StartDate]))))

Please reply to this thread with any new information or opinions.

Similar Threads

  1. workinkg hours by percent
    By Mosely in forum Queries
    Replies: 1
    Last Post: 11-01-2010, 09:32 AM
  2. Mixed dates - show only complete dates?
    By weeblesue in forum Queries
    Replies: 3
    Last Post: 10-27-2010, 02:15 PM
  3. Grouping hours query
    By DMP84 in forum Queries
    Replies: 0
    Last Post: 08-26-2010, 07:15 AM
  4. Replies: 2
    Last Post: 07-20-2010, 11:02 AM
  5. hours + condition
    By Miriam in forum Queries
    Replies: 0
    Last Post: 08-09-2009, 06:46 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums