Hmmm:
1. Why are you adding 1 to the difference between your start and end date?
If you get this number first, you should be able to caculate the number of weekdays between except for the modulus part..
2. Once you get that number taken care of, all you have to do is find how many weekdays have passed on the past MODULUS number of days.
If you have the @WDAYNO you can figure out how many Weekdays came before.
I'm sure a pure math formula will do this, but because I can't think of one...
code:
$weekdayarray = 0,1,1,1,1,1,0,0,1,1,1,1,1,0
$wdayno = VAL("@Wdayno")
IF $MOD > $wdayno $Wdayno = $wdayno + 7 endif
for $n = ($WDAYNO - 1) to ($WDAYNO - $MOD) STEP -1
$weekdaysinmodulus = $weekdaysinmodulus + $weekdayarray[($n-1)]
Next
Yes, I'm sure there is an easier way... my brain is semi-fried though... good luck.
Brian
{edit} bear with me.. still messing with this.. not working right..
{edit} it appears to work.. needs further testing..
[ 04 June 2002, 23:35: Message edited by: BrianTX ]