Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How many Sundays in a month?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00487391
Message ID:
00487405
Vues:
9
Try this:
FUNCTION countSundays
LPARAMETERS pnYear, pnMonth
LOCAL ldDate1, ldDate2
ldDate1 = date(pnYear, pnMonth, 1)
ldDate2 = gomonth(ldDate1, 1)

return int((d2-d1+dow(d1)) / 7)
ENDFUNC

Hi All, What would be the best approach to find out how many Sundays are with in a month?
>
>would I have to iterate each day, and count how many dow()=1 and count them between the first of the month and last off the month?



HTH,
- Erik Niese-Petersen

Crazy Dane in USA.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform