Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Counting weekdays between two dates
Message
 
À
21/06/2004 09:46:28
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00915620
Message ID:
00915621
Vues:
15
? 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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform