Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

date formula in access query 1

Status
Not open for further replies.

brumy

Programmer
Aug 3, 2003
6
0
0
US
I need to exclude weekends in a query formula =dateadd ("y",+2,[date returned])

Date returned is when a package is provided to someone for corrections with an expected suspense of return 2 days later -- I just need to make sure the 2 days are work days only

Any help?


 
=IIf(Weekday([Date Returned], vbSaturday) > 5, DateAdd("d", 4, [Date Returned]), DateAdd("d", 2, [Date Returned]))

Using vbSaturday as the first day of the week means that Thursday = 6 and Friday = 7, hence add 4 days; otherwise just add 2 days.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top