Posted on 2007-03-26
Crystal Reports 9:
I got this formula that is supposed to calculate the weekdays in the month and it supposed to not include saturday and sunday. This is what I have.
Local DateTimeVar d1 := PrintDate;
d1 := DateSerial(Year(d1), Month(d1), 1);
Local DateTimeVar d2 := PrintDate;
d2 := DateSerial(Year(d2), Month(d2)+1, 0);
DateDiff ("d", d1, d2) -
DateDiff ("ww", d1, d2, crSaturday) -
DateDiff ("ww", d1, d2, crSunday)
It comes up to: 21
but it is supposed to be 22. Can anyone help me to find out what is going on?