Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Counting weekdays between two dates
Message
 
To
21/06/2004 09:46:28
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00915620
Message ID:
00915621
Views:
16
? GetDays(DATE(2004,01,01), DATE(2004,04,03))


FUNCTION GetDays(dat1, dat2) 
   LOCAL next_loop, diff, ret_val, dDate
   diff = dat2 - dat1 + 1
   ret_val = 0
   FOR next_loop = 1 TO diff
       dDate = dat1 + next_loop
       IF .NOT. INLIST(DOW(dDate),1,6) && or 6,7
          ret_val = ret_val + 1
       ENDIF
   NEXT
RETURN ret_val
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Reply
Map
View

Click here to load this message in the networking platform