Working days/hours in a query
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;
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!