What's a function for updating dates like Mother's Day? (1 Viewer)

MS ACCESS PROBZZZ

Registered User.
Local time
Today, 15:24
Joined
Jun 12, 2018
Messages
29
I'm making a press release database which needs to track up coming holidays in order to set reminders. It's easy to enter fixed date holidays. But many of our holidays are on the second Sunday of a month or something like that. So the date changes year to year.

I don't know what the Access object for "day of the week" is. So I don't know how to write a function which requires that.

Can anyone give me an example of what a function like this would look like?

Thanks!
 

isladogs

MVP / VIP
Local time
Today, 23:24
Joined
Jan 14, 2017
Messages
18,209
I can't help you with Mother's Day which I believe varies depending on your country location but this thread includes functions for Easter Sunday and for several other holidays

https://access-programmers.co.uk/forums/showthread.php?t=294630

I wrote the Easter Sunday function by adapting some code for Excel written by the late, great Chip Pearson
Compared to Easter, everything else is a 'doddle'

BTW: The function is Weekday and gives a number output compared to a specified start day - by default Sunday is day 1
So a Monday is day 2 etc
 
Last edited:

isladogs

MVP / VIP
Local time
Today, 23:24
Joined
Jan 14, 2017
Messages
18,209
You're welcome.
The Easter code is amazing - I couldn't have written it without Chip's help

Also, see attached for a number of useful date functions compiled by fellow AWF member Pat Hartman
 

Attachments

  • UsefulDateFunctions.zip
    200.3 KB · Views: 102

Pat Hartman

Super Moderator
Staff member
Local time
Today, 18:24
Joined
Feb 19, 2002
Messages
43,203
Here's a database with useful date functions. One generates all the dates in a month for a specific weekday.
 

Attachments

  • UsefulDateFunctions180618.zip
    231 KB · Views: 119

Users who are viewing this thread

Top Bottom