Time Question filtering out weekends and mondays

Q

Qaspec

Im using the following expression in a query to find the average time elapsed
between the time a case started to the time it ended. the problem is cases
are not worked on saturday, sunday or monday. For our business we want to use
an elapsed time that would not count those three days as time. For example if
a case is started friday at 8am and finished the immediate wednesday at 9am
that should be 49 hours instead of 121 hours.

Actual Start Actual End Elapsed: Avg((DateDiff("n",[Actual Start
Date],[Actual End Date])/60))

Thanks for your help.
 
R

Ron2006

Im using the following expression in a query to find the average time elapsed
between the time a case started to the time it ended. the problem is cases
are not worked on saturday, sunday or monday. For our business we want to use
an elapsed time that would not count those three days as time. For example if
a case is started friday at 8am and finished the immediate wednesday at 9am
that should be 49 hours instead of 121 hours.

Actual Start Actual End Elapsed: Avg((DateDiff("n",[Actual Start
Date],[Actual End Date])/60))

Thanks for your help.

Here is a method of computing work days IF Saturday and Sunday are not
work days

1) Compute the number of working days between two dates:

workdays =DateDiff("d",[StartDate],[EndDate])-(DateDiff("ww",
[StartDate],[EndDate
],7)+DateDiff("ww",[StartDate],[EndDate],1)) + 1


DateDiff("ww",[StartDate],[EndDate],7) computes the number of
Saturdays

DateDiff("ww",[StartDate],[EndDate],1) computes the number of Sundays

you could add

DateDiff("ww",[StartDate],[EndDate],2) computes the number of Mondays

By subtracting the above three items you would have the number of
"Work" days.

Ron
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top