Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

time duration munus non-productive hours

Status
Not open for further replies.
Oct 6, 2002
60
0
0
US
Good day experts,

This one is pretty tricky.....I think. I am tracking the duration of production time (in minutes) involved in completing a task, the calc. is pretty basic "TIME TO COMPLETE TASK: Int(DateDiff("n",[TaskStarted],Now()))". This is working out pretty well with one exception, no production on weekend nights. A task can span several days, for example it could start on Friday maybe 3:00 PM and finish Monday at 11:00 PM. I need to find a way to test if any time between "taskStarted" and now() includes Friday night, Satruday night, or Sunday night (production ends at 6:30 PM each of these days) and then subtract those hours from the "TIME TO COMPLETE TASK" field since there is no production at those times. I have searched this forum and the web and have been unsuccessful. Any help would be greately appreciated.

Thanks,
Ryan
 
Hi Ryan

I would suggest using the "WeekDay" function and a loop to find out if any day between your start and end is a Friday/Saturday/Sunday and then using a time comparison to assess what hours are being used up on those days. Obvioulsy if it is a full day then you know the hours otherwise a simple calulation will tell you the differece.

HTH



----------------------------
SnaveBelac - Adventurer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top