Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to compute average of several dates
Message
From
05/11/2004 06:34:37
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00958360
Message ID:
00958432
Views:
19
I guess I didn't make it clear in my previous message that I was in fact suggesting a solution. I was trying to say:

[1] Subtract DATE() from each date. This will give integers which mean "number of days ago".
[2] Average these integers and convert the answer to an integer.
[3] Subtract this result from DATE() and you're done.

If your field is called DateField:
   CALC SUM(DATE() - DateFld), COUNT() to m.Total, m.Count
   m.AvgDate= DATE() - ROUND(m.Total / m.Count,0)
Jim Nelson
Newbury Park, CA
Previous
Reply
Map
View

Click here to load this message in the networking platform