View Full Version : Working days/hours in a query


eddie442
11-19-2008, 07:43 AM
I hope someone can help me with this query.

Our admin team have a database where they store all requests (stationery orders etc). Dependant on the request, they have a certain amount of time in which to complete it. It could be 24 hours, 5 working hours, 1 working hour etc. The times and dates are stored in the following fields;

RequestDate
RequestTime
CompletedDate
CompletedTime

I should say here that their working day runs from 09:00-17:00 Mon-Fri.

I can create a query easily enough if the times are within working hours/days. My problem is that if a request comes in after 12:00 noon, they have until 17:00 the following day to complete it. How can I legislate for weekends if this request falls on a Friday? The same issue occurs for requests that have to be answered inside 5 hours. If the request comes in at say 16:00, then they have until 13:00 the next day to complete it. How can I take into account the working hours and non-working days for these?

I'd be really grateful for any help!

Many Thanks
Dave

Rabbie
11-19-2008, 08:19 AM
There have been procedures posted on these forums to calculate "Working days" Try searching for this info. These procedures will also let you ignore Bank Holidays/Public Holidays etc

eddie442
11-20-2008, 12:11 AM
Cheers, thanks for that, I've found what I need. Was panicking yesterday and not thinking clearly!

Rabbie
11-20-2008, 12:28 AM
Glad to hear you have found what you need. Happy to have been of help