Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Number of days between two dates
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows 2000 SP4
Network:
Windows 2000 Pro
Database:
Visual FoxPro
Divers
Thread ID:
01248561
Message ID:
01248598
Vues:
21
>hi all,
>I have a customer who wants the average stock sold on a daily basis. what i need to find out is when he enters 2 dates, a from and a to, how do i calculate how many mondays, tuesdays.. there are in that range. its not enough to count the week numbers i need to find out that there were 3 mondays, 3 tuesdays, 4 wednesdays etc.
>~M
ldFrom = date()-7
ldTo = date()
create cursor cDates(dDate D)
for n=1 to ldTo-ldFrom
	insert into cDates(dDate) value(ldFrom+n-1)
endfor
select cast(cdow(dDate) as C(10)) as dow, count(*) as cnt from cDates group by 1
Doru
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform