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!

Criteria in Agregate Functions

Status
Not open for further replies.

CathieF

Technical User
Jan 18, 2002
8
US
I have data that needs to be summarized for different time intervals after a particular date . I Created a query that calculates months post the particular date and includes all the data that needs to be summarized.

I have a table for the particular time period names : 6 Weeks, 6 months, 1 year, 2 years, etc and columns for the minimum and maximum number of months post the date that would allow the data to fall under each time period.

I then created a form that allows the user to choose the time period they want to look at and a link to a report that should summarize the data for that time period.
I am having problems with the criteria portion of DAvg and DCount for the chosen time period only.
Here is my expression for the control source of an example field:
=DCount(&quot; [EvalAcetCompRadioTotalInfo]![AcetabularDataID] &quot;,&quot;EvalAcetCompRadioTotalInfo&quot;,&quot;( [EvalAcetCompRadioTotalInfo]![MonthPostOp] >( [ListTimePeriod]![MinMo] Where( Forms![Summaries of Results]![TimePeriod] = [ListTimePeriod]![TimePeriod])) AND [EvalAcetCompRadioTotalInfo]![MonthPostOp] <( [ListTimePeriod]![MaxMo] Where( Forms![Summaries of Results]![TimePeriod] = [ListTimePeriod]![TimePeriod])) OR [EvalAcetCompRadioTotalInfo]![MonthPostOp] =( [ListTimePeriod]![MinMo] Where( Forms![Summaries of Results]![TimePeriod] = [ListTimePeriod]![TimePeriod])) or [EvalAcetCompRadioTotalInfo]![MonthPostOp] =( [ListTimePeriod]![MinMo] Where( Forms![Summaries of Results]![TimePeriod] = [ListTimePeriod]![TimePeriod]))&quot;)

I know it is long...
Is there a better way to do this or can this way be made to work?

Thank you,
Cathie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top