Sum of 2 lines of Count query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello Access community,
I am a novice and want the sum of a query that results in
CountID Type
10 1
2 2

I would like to know how to get the sum of 12, preferably as a new field
within that same query, or else in a new query. Thank you in advance.
Mary
 
Just wrap you query in another query

Select Sum([Countid]) as SumOfCountID
From (Select Count([someField]) as CountID from [sometable])
 
You will need another query that uses this query as its recordsource. It
should have only one field, CountID, and be a Totals query using Sum in the
Group by.
 
Can you nest the count query into that main query in any way? thanks Klatuu,
m
 
Sorry, Mary, I really don't know if you can. It might be possible with a
CrossTab query, but I skipped class that day and it is a weak point for me.
 
Hello Access community,
I am a novice and want the sum of a query that results in
CountID Type
10 1
2 2

I would like to know how to get the sum of 12, preferably as a new field
within that same query, or else in a new query. Thank you in advance.
Mary

Not at all easily. A hairy UNION query might do it.

However, if you just want to *see* these subtotals, consider using a
Form (for onscreen use) or Report (for printing). Base it on this
query and put a textbox on the Form (or Report) footer with a control
source

=Sum([CountID])

John W. Vinson[MVP]
 

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

Similar Threads

SUM in a UNION query 2
Crosstab Query Issue 1
Running Sum in Query for Count Field 0
Sum a count total 2
Split data in field on character return 0
Query Question 3
Sum using totals 2
Cross Tab Query...Help 4

Back
Top