Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Week Function
Message
De
16/12/2008 10:33:42
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows NT
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01367670
Message ID:
01367892
Vues:
9
>>>>
>>>>? WEEK({^2008-12-28},2)
>>>>
>>>>brought me 53 (what sounds logical to me)... but I'm a little affraid if in others years I'll reach others behaviors... But, anyway... This is what may I use from now own...
>>>>
>>>
>>>Try
>>>
>>>
>>>? WEEK({^2012-12-31},2)
>>>
>>
>>Yeah.. brought me 1
>>
>>How did you get exactly the value of year 2012 I mean.. did you try all 31 days untill there or has follow any other logic?
>>
>>to deal with that I just see
>>
>>
IF  lnweek = 1 AND lnmes>11
>>     lnweek			= 53
>>endif
>>
>>sounds not smart.. but??
>
>What about
>
>? WEEK({^2009-01-01},2)
>
>
>What is your definition of a Week?

against that I'm already using two functions to divide on the timeline object the weeks on dif. months and dif. years:
function thisSunDay
Lparameters m.date
Private m.date,i,lnoldm,llcontinue
lnoldm=MONTH(m.date)
llcontinue						= .t.
Do While Dow(m.date)<>1 AND llcontinue
	IF  (month(m.date-1))<>lnoldm
		llcontinue				= .f.
		loop
	endif
	m.date=m.date-1
Enddo
Return(m.date)
endfunc
function thissaturDay
lparameters m.date
Private m.date,lnoldmes,llcontinua,lnprxd
lnoldm						= MONTH(m.date)
llcontinue						= .t.
Do While Dow(m.date)<>7 AND llcontinue
	lnprxd					= m.date+1
	IF  MONTH(lnprxd)<>lnoldmes
		llcontinue				= .f.
		loop
	endif
	m.date					= m.date+1
Enddo
Return(m.date)
"Now to him who is able to do immeasurably more than all we ask or imagine, according to his power that is at work within us, Ephesians 3:20
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform