Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How many weeks in a month
Message
 
 
À
08/11/2007 11:56:04
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01266837
Message ID:
01267710
Vues:
21
Hi Sergey,

Is this better? :)
ldLastOfYear    = DATE(lnYear, 12, 31)
lnWeeksInYear   = MAX(WEEK(ldLastOfYear,1,2), WEEK(ldLastOfYear-7,1,2))
lnWeeksPerMonth = MOD(WEEK(GOMONTH(ldFirstOfMonth,1),1,2) + lnWeeksInYear - ;
					WEEK(ldFirstOfMonth,1,2), lnWeeksInYear)
Counting sundays could be simpler in this case though.

>Sorry for delay, I've been on vacation:)
>I've tested your code against mine. It gives wrong results for Decembers in some years, e.g. in 2000, 2006, 2012, 2017, 2023, ...
>
<snip>
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform