Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / February 2008

Tip: Looking for answers? Try searching our database.

Weekday Only Calc

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
aMack - 11 Feb 2008 15:37 GMT
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

Signature

A MACKENZIE, CMA, MBA

Marshall Barton - 11 Feb 2008 16:40 GMT
>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())

Signature

Marsh
MVP [MS Access]

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.