Weekday Only Calc

A

aMack

I am generating reports for a customer based on activity for the previous 2
working days. There is no activity on weekends, therefore i need the query
results of: "[Arrival Date]=Now()-2" to exclude weekends.

Help.

Thanks
 
M

Marshall Barton

aMack said:
I am generating reports for a customer based on activity for the previous 2
working days. There is no activity on weekends, therefore i need the query
results of: "[Arrival Date]=Now()-2" to exclude weekends.


Try using:

DateAdd("d", - 2 + 2 * (WeekDay(Now(), 2) < 3), Now())

ir, if that's too cryptic:

DateAdd("d", - 2 - IIf(WeekDay(Now(), 2) < 3, 2, 0), Now())
 

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