Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Counting Days
Message
De
16/10/2000 15:07:14
 
 
À
16/10/2000 14:53:20
Erin Eby
Mission Critical Software
Gainesville, Floride, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00429936
Message ID:
00429951
Vues:
19
>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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform