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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculating dates

Status
Not open for further replies.

ptrifile

Technical User
Aug 10, 2004
457
US
I have a report that reports on company orders and includes the following: CompanyName,Item#, Quantity, lastorderdate, average days between orders and next estimated order date.

"NEXT ESTIMATED ORDER DATE" is calculated by the following:

=DateDiff("d",Min([Date_ordered]),Max([date_ordered]))/Count([itemnumber])+Max([date_ordered])

i would like to create another report to only include the companies and what item # is estimated to be ordered within the next 30 days. I really have no idea on where to start for this....can anyone offer any suggestions?

Thanks in advance
Paul
 
put the calculation for next estimate date into the query that the report is based on, and then add a where statement limiting the estemated date to today + 30 (off the top of my head: dateserial(year(now()), month(now()), day(now()) + 30)

--------------------
Procrastinate Now!
 
When I put the calculation in for next estimate date into the query I get the following error:

Cannot have aggrigate function in WHERE clause

Am I doing something wrong?

Thanks again!

Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top