Early disclaimer... I am not a programmer. I have successfully (so far) snowed everyone I work with here, but make no claims amongst a group of actual professionals.
That said, could you create in ABL logic similar to:
NumberOfDays = EndDate - StartDate
Loop: for each ProdCalDay where ProdCalDay.ModifiedDay > StartDate AND ProdCalDay.ModifiedDay < EndDate
if ProdCalDay.WorkingDay = FALSE then OffDays = OffDays +1
CalculatedDays = NumberOfDays - OffDays
If this provides you with nothing but a good laugh, then my day is also complete...
Ernie Lowell
Diba Industries
---In vantage@yahoogroups.com, <vantage@yahoogroups.com> wrote:I understand how to set up Calendars. My challenge is how do I figure out the number of work days based on a calendar between two dates.
Example: “ PORel.PromiseDt – TODAY “ gives me the number of days until the promise date.
If needed, I could calculate the number of weeks between days, take into account what day of the week it is now, and could eventually get to the number of workdays. A glorified version of “ PORel.PromiseDt – TODAY – trunc ((PORel.PromiseDt – TODAY) / 7 * 2) is a good approximation of the number of weekdays between the two days.
I just don’t know if anyone has some way of taking into account a calendar.
Thanks again.
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of gracefulthreads@...
Sent: Thursday, October 24, 2013 8:31 AM
To: vantage@yahoogroups.com
Subject: [Vantage] RE: Days between two dates based on calendar
Kevin,
Use the Production Calendar to set weekends and holidays as non-work days (if your company default production calendar shows weekends as WORKING days, just create a second one). I'm doing that in a couple of BPMs to reset Sales Order and Purchase Order dates... it will be a little hairier in a BAQ but should be doable.
Ernie Lowell
Diba Industries
---In vantage@yahoogroups.com, <vantage@yahoogroups.com> wrote:Does anyone know of a way to calculate the number of working days between two dates and base that on the working days of a calendar.
For example, if I have a company calendar that has only M-F as work days, and then has the Thu-Fri off for Thanksgiving, if I want to calculate the days between 10/31/13 and 11/30/13, it would return 19 days (30 days, less 9 weekend days, less the two holidays)?
I’m trying to do this in a BAQ.
Thanks.
Kevin Simon