weekend calculation

G

Guest

My order system currently counts data after 2:00 PM as next day. When adding
up how many orders per day we received, I added an IIf statement that states

IIf(TimeValue([Date/Time])>#2:00:00
PM#,DateAdd("d",1,DateValue([Date/Time])),DateValue([Date/Time]))

The only problem is that for Fridays, it adds one day which of course makes
it counted for Saturday, but it should be counted for Monday. How do I go
about making Access realize if it is a Friday - DateAdd "d" 3, instead of 1
days?
 
W

Wayne Morgan

Nest IIf statements. Check to see if today if Friday, if so, add 3 instead
of 1.

IIf(TimeValue([Date/Time])>#2:00:00 PM#,
IIf(Weekday([Date/Time]) = 6, DateAdd("d",3,DateValue([Date/Time])),
DateValue([Date/Time])))
 

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