Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Determine how many work days between two dates
Message
De
22/05/2003 12:46:02
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
22/05/2003 03:05:49
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00791473
Message ID:
00791711
Vues:
21
>Hi,
>
>Has anyone had to work this one out before. Either how many work days between 2 dates or how many weekends between the 2 dates.
>
>Regards
>Doug Johnston

Assuming holidays doesn't matter :
lparameters tdD1, tdD2, tnWorkDaysInWeek
* First day of workday is Monday - 2
tnWorkDaysInWeek = iif(empty(tnWorkDaysInWeek),5,tnWorkDaysInWeek)
return floor(abs(tdD2-tdD1)/7) * tnWorkDaysInWeek + ;
  min(dow(max(tdD1,tdD2),2),tnWorkDaysInWeek) - ;
  dow(min(tdD1,tdD2),2) + 1
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform