How to Find the Next or Previous Business Day in Microsoft Access

preview_player
Показать описание
In this Microsoft Access tutorial I'm going to teach you how to calculate the next business day following any date in your queries. Then we'll also use the same logic to calculate the previous business day.

Aimee from El Paso, Texas (a Platinum Member) asks: I need to be able to calculate the next business day following an order date. For example if the order comes in on a Saturday I need the following Monday. How can I do this?

Silver Members and up get access to an Extended Cut of this video. Members will learn how to create a VBA function to calculate next and previous business day so that function can be used anywhere in the database including forms and reports.

MEMBERS VIDEO:

BECOME A MEMBER:

LEARN MORE:

PRE-REQUISITES:

LINKS:

THE CODE:
D: CustomerSince
WD: Weekday(D)
WDN: WeekdayName(WD)
NextBizDay: IIf(Weekday([D])=6,[D]+3,IIf(Weekday([D])=7,[D]+2,[D]+1))
NWD: Weekday([NextBizDay])
NWDN: WeekdayName([NWD])
PrevBizDay: IIf(Weekday([D])=2,[D]-3,IIf(Weekday([D])=1,[D]-2,[D]-1))
PWD: Weekday([PrevBizDay])
PWDN: WeekdayName([PWD])

RECOMMENDED COURSES:

FREE TEMPLATE DOWNLOADS:

ADDITIONAL RESOURCES:

KEYWORDS:
access 2016, access 2019, access 2021, access 365, microsoft access, ms access, ms access tutorial, #msaccess, #microsoftaccess, #help, #howto, #tutorial, #learn, #lesson, #training, #database, next business day, previous business day

QUESTIONS:
Please feel free to post your questions or comments below. Thanks.
Рекомендации по теме
Комментарии
Автор

Hi Richard another great video very interesting video I got your last email ok about pension database all best Steve b

stephenbeswick
Автор

Great video as always. Have a question tho. With your function NextBusinessDay in your case statement you have case 6 ' Saturday and you have case 1 for Sunday. Should it not be case 6 and case 7 then Sunday be in the else because all days but Friday and Saturday are just add a day? Not sure if the loop has something to do with it. My 2 cents I think a case 1, 6, 7 NextBusinessDay = D + 8 - Weekday(D, 2) else NextBusinessDay = d + 1 then like I said not sure about the loop.

robertstoner
Автор

Does anyone know how to use mailmerge in vba without reopening the current database or writing the data you want to put into the word-template into a seperate txt first? It's really frustrating to get mailmerge to function properly and I can't find any good solutions for it.

freddimehrcurry