# Thread: Date Calculation (Access 2002)

1. ## Date Calculation (Access 2002)

Hi

A quick search of this forum and other sites, does not seem to answer this slight variation on a date calculation I require. I have public holiday that falls on 25 October every year. However, the actual day observed for the holiday is the nearest Monday to the 25th. So I need to determine the actual date the holiday is observed (which may well be the 25th for some years) for any particular year.

So far I haven't been able to think of a solution and would appreciate some advice on the matter.

Thanks & Regards

WTH

2. ## Re: Date Calculation (Access 2002)

The following function (put in a standard module) will calculate the nearest Monday for any given date:

Public Function NearestMonday(aDate As Date) As Date
NearestMonday = aDate + 4 - Weekday(aDate, vbFriday)
End Function

The nearest Monday to 25-Oct-2005 is NearestMonday(#10/25/2005#)

3. ## Re: Date Calculation (Access 2002)

Hi Hans

As usual a speedy and great solution saving me heaps of time.

Many thanks

WTH

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•