Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Average Days

Status
Not open for further replies.

Callison

Technical User
Nov 6, 2002
2
0
0
US
I am trying to build a report that looks @ dates (at the detail level) and returns an average of days between orders. Anyone have an Idea?

Callison
 
I'm assuming that there you are looking for the number of days between orders placed by the same customer, otherwise the answer is likely 0 since they probably have lots of orders daily.

To do this, you need to set up a report that groups by customer and sorts by date. Next check out Crystal Reports help for info on the "DateDiff" function and "Running Totals." In particular see the section on "Creating running totals using a formula." I think you'll need to set up multiple running total variables to do this. Sorry I don't have more time to explain this but I think this should help get you started.
 
Another approach is to take the difference between the first order and last order in the list, and then divide this by the number of orders. The result should be the average time between orders. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
I feel like an idiot. I'm trying to develope algorithms for this and all I need is the # of days and a count. Sometimes things are much easier than they seem.

Thanks,

Callison
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top