Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Number of days between two dates
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows 2000 SP4
Network:
Windows 2000 Pro
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01248561
Message ID:
01248598
Views:
20
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform