投稿済み Thu, 21 Jan 2021 13:03:22 GMT 、投稿者 Daniel Walker-Cheetham Reigate Grammar School Senior Finance Assistant
I am creating a absence request form and have 'from' and 'to' date fields on the form. I have managed to calculate the number of days being requested but it doesn't take weekends into consideration.

How do I calculate the number of days but exclude any dates which are weekends / public holidays?

Thank you in advance!
 
投稿済み Thu, 28 Jan 2021 13:03:23 GMT 、投稿者 Matthias Wieland DocuWare Europe GmbH Sr. Director Support EMEA
Dear Daniel Walker-Cheetham! It looks like the Community cannot answer your question. That's why we have opened a Support Request with the Number SR-142891-R3G3Q for you. A Software Support Specialist will contact you directly to follow up. We will update this thread with the solution as soon as we have resolved the Support Request. With best regards, DocuWare Support Team
投稿済み Fri, 29 Jan 2021 06:59:29 GMT 、投稿者 Fabian Kall - left 01.22
There might be a clever VBA Function You can use in an arithmetic expression in Workflows.

A simple, purely imperative solution could be:

Create a loop in a workflow, where you iterate from your "from"-Date to your "to"-Date in DateInterval.Day intervals with the DateAdd Function.
In every iteration check, if your current date is a Workday with the Weekday-Function. Increment a counter variable if it a weekday, otherwise don't.

Beware that there is a safeguard in workflows, that prevents exceeding the number of executions of a workflow activity within a certain amount of time (I believe the threshold is 50?). You shoud find KBA-posts on that. If you have to deal with large numbers of loop iterations, have the workflow wait after a certain number of loops.
投稿済み Wed, 01 Mar 2023 13:43:25 GMT 、投稿者 Adam Lawrence
Was anyone able to get this to work?

フォーラムに投稿するためにはログインが必要です。