Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Week by Month
Message
 
 
À
27/12/2006 06:22:32
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01180294
Message ID:
01180447
Vues:
15
Here's more compact version
FUNCTION NthDowOfMonth(tnYear, tnMonth, tnWeekNum, tcDow)
LOCAL lnDOW, ldDate, lnDowPos
lnDowPos = AT(UPPER(PADR(tcDow,3)), "SAT SUN MON TUE WED THU FRI")
IF lnDowPos = 0
	ldDate = {}
ELSE
	TRY 
		lnDOW  = DOW(DATE(tnYear, tnMonth, 01), INT(lnDowPos/4) + 1)
		ldDate = DATE(tnYear, tnMonth, 7 - lnDOW + 1 + (tnWeekNum -1)*7)
	CATCH
		ldDate = {}
	ENDTRY
ENDIF	
RETURN ldDate
>I dared to expand it to make it more generic
>one can E.G. get the second tuesday of the month:
>but it is not so compact anymore
>
<snip>
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform