Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Add Work days to a date
Message
De
02/04/2007 12:31:31
James Blackburn
Qualty Design Systems, Inc.
Kuna, Idaho, États-Unis
 
 
À
02/04/2007 11:46:20
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01211326
Message ID:
01211351
Vues:
16
Thanks Edward,

This is close but but it uses Tuesday through Saturday. Here is my test code.
CLEAR 
d1={^2007-04-03}

FOR lnx = 1 TO 20 
 ?AddWorkDays(d1,lnx)
NEXT 

FUNCTION AddWorkDays(startDate,nAdddaysnumber)
  	LOCAL nDay[2]
		ldDate = (Startdate+7*floor(nAdddaysnumber/5))+MOD(nAdddaysnumber,5)
		return TRANSFORM(ldDate)+" "+CDOW(ldDate)
ENDFUNC 
>>Hi All
>>
>>Anyone have a good program to add the number of workdays to a date without looping through the dates? I am not worried about holidays and such. Just Monday through Friday.
>>
>>Thanks.
>
>Something like this:
>
>Function addworkdays
>Lparameters dStartdate,nAdddaysnumber
>Return dStartdate+7*floor(nAdddaysnumber/5)+MOD(nAdddaysnumber,5)
>
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform