Return Specific WeekDay

emcf

Member
Local time
Today, 22:23
Joined
Nov 14, 2002
Messages
209
weekday thing again

Afternoon all,

I know there have been a few posts on this topic in the past but i cannot seem to find what i am looking for...hopefully someone can point me in the right direction.

I'm 90% sure that i have seen the relevant module several months ago - basically it is a module that makes access ignore weekends. the modules i've seen on this site are all about calculating days between two dates ignoring weekends.

my database needs to look one day ahead to see if there are any relevant records for the next day...e.g. when i run a query tomorrow (thursday) i need to know what is going to be happening on friday. this is not a problem. the problem arises when i run it on friday and need to know what is happening on monday. I know i could use the dateadd and set it to bring thru results for the next three days to get over the weekend problem however i need to keep the data down to one day's worth - if i did this on a monday it would bring thru results for tues, wed and thursday.

is there a way to do this or will i just have to use the dateadd and bring thru more records than i want???

thanks in advance.
 
This will return the next date:

IIf(Weekday(DateAdd("d", 1, Date())) = 7, DateAdd("d", 3, Date()), DateAdd("d", 1, Date()))
 
thanks mile-o, i was thinking it had to be some horribly complex piece of code. i was looking thru this - http://www.mvps.org/access/datetime/date0012.htm

trying to work out what it did and if it would work for me....thankfully i don't have to now!!
 
...no-one will open the db at the weekend. i realise (i think!?!) that there would be a problem if i opened it on a saturday but i won't be here then...saturdays be rugby days!
 

Users who are viewing this thread

Back
Top Bottom