>In my program I need to cacluate the working days of every month. Does Visual Foxpro provide this function. my region is Hong Kong. please give me some reference. thanks a lot!
Here is another way to calculate the number of working days in a month.
If the month has 28 days, it will always have 20 working days (assuming a 5 day work week). Therefore you only need to check the if the days of the month past the 28th are work days to get the total number.
ldMonthStart = {^2002/03/01}
ldMonthEnd = {^2002/03/31}
lnDaysInMonth = ldMonthEnd - ldMonthStart + 1
lnWorkDays = 0
IF lnDaysInMonth > 28
FOR i = 28 TO lnDaysInMonth - 1
lnDayOfWeek = DOW(ldMonthStart + i,1)
IF lnDayOfWeek <> 1 AND lnDayOfWeek <> 7
lnWorkDays = lnWorkDays + 1
ENDIF
ENDFOR
ENDIF
? 20 +lnWorkDays