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(" [EvalAcetCompRadioTotalInfo]![AcetabularDataID] ","EvalAcetCompRadioTotalInfo","( [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]))"
I know it is long...
Is there a better way to do this or can this way be made to work?
Thank you,
Cathie
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(" [EvalAcetCompRadioTotalInfo]![AcetabularDataID] ","EvalAcetCompRadioTotalInfo","( [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]))"
I know it is long...
Is there a better way to do this or can this way be made to work?
Thank you,
Cathie