Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Compute vacation
Message
 
À
04/10/2004 05:17:50
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00948387
Message ID:
00948392
Vues:
16
>hi all,
>
>if i want to take (21 or more or less) days as vication
>how i can compute how many days i have ,without friday+saturdy days
>
>thisform.text1.value=startdate
>thisform.text2.value=enddate
>thisform.text3.value=thisform.text1.value-thisform.text1.value&&(without friday+saturdy days)
>
>thanks.

Mohammed, the first think that comes to my mind is to wrote the function that calculate this:
thisform.text1.value=startdate
thisform.text2.value=enddate
thisform.text3.value=CalculateDays(startdate, enddate)


FUNCTION CalculateDays(startdate, enddate)
  LOCAL cycle, tocycle, testdate, ret_val
  ret_val = 0
  tocycle = enddate-startdate
  FOR cycle = 0 TO tocycle
      testdate = startdate+cycle
      IF .NOT. INLIST(DOW(ScanDay,1), 6, 7)  && friday, saturday
         ret_val = ret_val + 1
      ENDIF
  ENDFOR

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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform