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

Mulitple queries in a report.

Status
Not open for further replies.

Chelsea7

Programmer
Aug 25, 2008
69
US
Hello everyone,

I'm trying to include two queries in a report. According to the Report Wizard, this can be done. However, when I try I keep getting
"You have chosen fields from record sources which the wizard can't connect. You may have chosen fields from a table and from a query based on that table. If so, try choosing fields from only the table or only the query."

Is there any way to have two queries separate and unrelated to each other in a report? I don't want to do a subreport, because calculations are done in the other fields. Basically, what I'm trying to do is have one query count the total records and the other query count the number of lets say records that do not contain "Detroit". If I use a where command in the query, it will select only the records that do not contain "Detroit" So, only those records will be counted if I put this all in one query. Sometime like this;

Total Records City
20 5
I hope I'm in the right forum. I wasn't sure if it should be here are the SQL forum. Any assistance will be apreciated.
 
Sorry, if they aren't related then you will HAVE to use subreports. Or if you want you could use DLookups to get the query values if the queries only return a single value. But I would use subreports anyway because they are much faster than DLookups.

You can refer to subreports for calculations - you would have to use the correct syntax to refer to a control on a subform but you can use this method to do it easily:

Bob Larson
Free Access Tutorials and Samples:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top