Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Need assistance with a date-related algorithm
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
00989784
Message ID:
00989787
Vues:
29
>I was wondering if someone would know of a reliable algorithm to count the number of Saturdays and the number of Sundays between 2 dates (inclusively)...?
>
>Laterness,
>Jon
FUNCTION CountWeekEnd(dData1, dData2)

  LOCAL ret_val
  DO WHILE dData1 <= dData2
     IF INLIST(DOW(dData1,1),1, 7)
        ret_val = ret_val + 1
     ENDIF
     dData1 = dData1 + 1
  ENDDO

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