How in Access do I use Date()+2 missing weeknds (e.g Thu+2 = Mon)

G

Guest

I'm using a query that has a field date()+2 to give me a flag date 2 days
ahead of today. This is fine for a Monday, Tuesday or Wednesday where the
flag date is therefore Wednesday, Thursday or Friday. However, I need the
flag date when run on a Thursday to return the date of the following Monday,
and for a Friday the following Tuesday - i.e. to work on a working day basis
leavng out weekends.
Is this possible?
Thanks all
Gary Donovan
 
C

Chris M

Well, there's a function WeekDay() which returns 1-7 representing the day of
the week.
I guess you could construct a fairly simple function that varied the number
of days to add depending of the day of the week of the original date.

eg.

date() + (iif(WeekDay(Date()),4,5,iif(WeekDay(Date()),6.......... etc.


Chris.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top