All I want to do is, within a loop, move from a day to the prior weekday, execute some code, move to the prior weekday, execute some code etc. Moving to the prior weekday seems to fail when around month boundaries. I cannot for the life of me determine why this is not working. Please note the following:
20101031 is a Sunday so moving to the PWD should give 20101029, a Friday, but it produces a result of 20101028, a Thursday. If I change &NEWDATE to 20101030, a Saturday, I get a result of 20101028.
If I change &NEWDATA to 20101101 then the code works properly. It seems that if the date I'm trying to convert/move falls on a weekend then the code fails. Do you think I'm gonna have to code something that looks at the day of the week and then move one day at a time and lok at the day again etc. I'm stumped.
previous weekday (WD-) also works but would not cater for holidays.
In FOCUS since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2
WebFOCUS App Studio 8.2.06 standalone on Windows 10
November 22, 2010, 02:18 PM
I tried your suggestion and it does indeed work when the date I am moving from is a weekend day but fails when the day is a weekday. I suspect I'm going to have to do some very specific checking on the day of the week and branch off accordingly.
Looks to me like there is a bug when using the 'PWD' parameter with DATEMOV. Here's a work-around that seems to work. Subtract one day from the start date and then use DATEMOV with the 'WD-' parameter. This will move to the previous workday if the current date is a weekend, but leave the date where it is if it's a weekday.