Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Counting Days
Message
From
16/10/2000 15:07:14
 
 
To
16/10/2000 14:53:20
Erin Eby
Mission Critical Software
Gainesville, Florida, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00429936
Message ID:
00429951
Views:
20
>Hi there. I tried to find the "Stupid Questions" category for this one, but it didn't exist. :) Is there a way to count the number of business days (which would be everyday but Sat. and Sun.) that have occurred from Jan. 1st to today? just wondering....tia.

Probably not the most elegant way, but it's fast
ldStart = DATE(YEAR(DATE()), 1, 1)
lnBusDays = 0
FOR ji = 0 TO DATE()-ldStart
  IF !INLIST(CDOW(ldStart+ji),"Saturday","Sunday")
    lnBusDays = lnBusDays + 1
  ENDIF
ENDFOR
Of course, there could be holidays (like July 4th) which might not be considered business days.
Insanity: Doing the same thing over and over and expecting different results.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform