Question Locked

working date calculus

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Dear Sirs let me explain my problem to see if somebody has a solution to it:
- Software used: ACCESS 2002
- Problem: having a date I have to add a number of working days and the resul must be a date.
How can I do it?
The calculus has to be done in a Report or in a Query.
Thanks Franco

2 replies

by Former member

http://www.cpearson.com/excel/DateIntervals.htm

You should be able to use the Weekday function to eliminate records that occur on certain
days of the week. You may need to adjust for the first day of the week in your locality.

Weekday(#10/23/2003#) = 5 for Thursday, to eliminate weekends you would not want
Weekday([DateField]) to be 1 or 7. You would set this to be a calculated field in the
query.

In the Query design grid
Field: NoWeekends:Weekday([TableName].[DateField])
Criteria: <>1 And <>7

You could uncheck the Show box unless you need the numbers 2-6 (for Mon - Fri) in the
output of the query for something else. It will filter on this even if the value doesn't
show in the output.

Question, if you are only working on Mon through Fri, how did records get in on Sat and
Sun? If there aren't any, you may not need to filter them out. If they are there, then
weren't Sat and Sun work days also?

The syntax for the Weekday function is Weekday(date, [firstdayofweek])
http://bytes.com/forum/thread190368.html

Please post back if you have anymore problems or questions.

This discussion is closed to new replies.