Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Calculating work days
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Calculating work days
Divers
Thread ID:
00338999
Message ID:
00338999
Vues:
52
I'm looking for a function to calculate the number of work days; Monday - Friday, between two dates. I have an application that must do tons of these calculations so speed is quite important. ie - no looping through the date range to count the work days. My initial thoughts are:
get the number of days between the dates (nworkdays)
determine the start and end DOW
reduce nworkdays by work days left in start week
reduce nworkdays by number of days into end week
determine number of weeks in remaining days to get weekend days (nworkdays/7)*2
subtract weekend days from original nworkdays

Any thoughts on better approaches?
Better yet, anyone got such a function already written they would like to share.

TIA
Michael McLain
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform