Count of Multiple queries

S

Samer

Hi. I am hoping someone here can help me with what I want to do.

Here is an example of what I have:
QUERY #1: Title: Home1. Number of records: 610
QUERY #2: Title: Kitchen2. Number of records: 23
QUERY #3: Title: Kitchen2-2. Number of records: 20.

Here is what I want.
One table- that can be copied all at once with two columns: Query
Title and Count of the number of records in each query.

Example:
Name.........Number of Records
Home1.......610
Kitchen2.....23
Kitchen2-2...20

So basically, I want a list of all of my queries, and the count of the
number of records in each one in spreadsheet formet. I am approaching
15-20 queries and want to make it easier to get the count of each
UNRELATED query (designated by the query's title) into one spreadsheet
with two columns...any help or ideas would be greatly appreciated.
 
S

Samer

are you trying to display the data and do a count at the same time

Thanks for the response. I am trying to only display the count of
records per query in a list, using the title of each query to
designate.
 
L

Lord Kelvan

Mmmm

I have done what you wanted before but I had a control query to
resolve the cartesian product. So my control query was counting the
data in each query against as value.

category query1 query2 query3
cat1 val1 val1 val1
etc...

You can do what you want though but you will need to create a seperate
query that counts the records and that is all it does.

so your count queries will be something like

counthome1

select count(home1.field1) as home1
from home1

countkitchen2

select count(kitchen2.field1) as kitchen2
from kitchen2

[countkitchen2-2]

select count([kitchen2-2].field1) as [kitchen2-2]
from [kitchen2-2]

etc

then in another query you will have

select home1,kitchen2,[kitchen2-2]
from counthome1,countkitchen2,[countkitchen2-2]

Idont see a way around the cartesian product apart from that without a
control source sorry.

regards
kelvan
 
S

Samer

Mmmm

I have done what you wanted before but I had a control query to
resolve the cartesian product.  So my control query was counting the
data in each query against as value.

category query1  query2  query3
cat1          val1     val1     val1
etc...

You can do what you want though but you will need to create a seperate
query that counts the records and that is all it does.

so your count queries will be something like

counthome1

select count(home1.field1) as home1
from home1

countkitchen2

select count(kitchen2.field1) as kitchen2
from kitchen2

[countkitchen2-2]

select count([kitchen2-2].field1) as [kitchen2-2]
from [kitchen2-2]

etc

then in another query you will have

select home1,kitchen2,[kitchen2-2]
from counthome1,countkitchen2,[countkitchen2-2]

Idont see a way around the cartesian product apart from that without a
control source sorry.

regards
kelvan

Thanks for the response! I was hoping to avoid having to make a count
query query for each and every query. If you come across anything to
help avoid doing that, please let me know!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top