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

Calling a query

Status
Not open for further replies.

mama16

MIS
Oct 22, 2004
125
US
Hello,

I'm running a report based on one query, I'd like to add another field but it's on another query. Can I call that query into the report? I'm doing that but I keep getting the parameter box.
Any ideas?

Appreciate it.
 
is the other query that you are pulling into the report using the same parameter values as the other, or different ones???

Do you use a form to get these value from, or do you just type them in when asked for them...
 
This is what I first had,

SELECT Deployers.Deployers, Deployers.Population, Sum(Statistics.Tot_calls_by_Month) AS System_Total, Deployers.Months_Operational, Sum([Tot_calls_by_Month])/([Months_Operational]) AS Averagecallpermonth, Sum([Tot_calls_by_Month])/([Months_Operational])/([Population]) AS Calls_per_Population
FROM Deployers LEFT JOIN Statistics ON Deployers.Deployers = Statistics.Deployers
GROUP BY Deployers.Deployers, Deployers.Population, Deployers.Months_Operational;

I got all that to show on the report

Then I wanted to add two more fields from the table Statistic ( same table)
and in the design report view I created a text box and called this query from the control source

SELECT T.Deployers, T.Total, S.MonthYear
FROM Statistics AS S INNER JOIN [SELECT S.Deployers,
Max(S.Tot_calls_by_Month) As Total

From Statistics As S

GROUP BY S.Deployers]. AS T ON (S.Tot_calls_by_Month = T.Total) AND (S.Deployers=T.Deployers);


Like I said a parameter box pops up.
 
Replace this:
[SELECT
By this:
(SELECT
and this:
GROUP BY S.Deployers]. AS
By this:
GROUP BY S.Deployers) AS

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Let me see if I follow you, make changes to the second query. Then, call the second one into the report. They are two separate queries. I did the changes to the second one and I'm still getting the parameter box when I assign that query to the contol box. It looks something like this,
=(PeakMonthCallRD2.Total)

Any ideas?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top