I want to add a leadtime eg 10 working days to an order date. I can add 10 calendar days using the DateAdd function
DateAdd("d", 10, #Sept 28, 1999#)but need to know how to add 10 weekdays.
Local DateVar StartDate := Date(2003,11,27);
Local NumberVar NetDays := 5;
Local NumberVar Counter := 0;
While Counter <> NetDays do
(if Dayofweek(StartDate+Counter) in [1,7] or
StartDate+Counter in [Date(2003,12,02),Date(2003,12,03)] then NetDays := NetDays + 1;
Counter := Counter +1;
StartDate+NetDays;
Replace items in bold with your fields and items in italics with your holiday days.....
Reebo
UK
"Before you judge a man, walk a mile in his shoes. After that, who cares? ...He's a mile away and you've got his shoes." - Billy Connolly
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.