Report based on crosstab query

G

Guest

I have a crosstab query which returns the count of males and females in each
age group. I want to add a summary line which shows the total number of
males and total number females. I would appreciate any help or references to
articles. I have received much help from the discussion groups.
 
A

Allen Browne

If everyone is either Male of Female (no records where the gender is unknown
or indeterminate), then the count of Male + count of Female will be the
count of records.

In query design view, drag your primary key into the grid again.
In the Total row, choose Count.
In the Crosstab row, choose Row Heading.

This total appears on the left (where you might prefer it on the right), but
it should give the desired result.
 
G

Guest

Good morning, Allen, from rainy Iowa. And thank you for responding.

Actually I have that much of the query done, and I was trying to have a
summary line at the bottom of the report which gives the totals for males and
females (I actually have the "unknown" choice).

The report would read:
Age M F Unknown
10 2 1
11 3
12 3 3
15 1
Totals 5 6 2

Late last night, I finally figured out a report. I read through most of the
crosstab discussions and found a suggestion to just "try different wizard
reports" and found that I was able to add fields to the tabular report that
work. I think one of my fundamental thinking flaws was my lack of
understanding that the "detail" for a crosstab query is actually the lines
reporting the count (not the individual records) and I had the count fields
in the wrong report section.

It also took me a while to figure out that for the fields from the crosstab
query to be available through the wizard, it was necessary to list the column
headings in the properties of the query, and that these column headings had
to be exactly the same as entered in the field ("M," which was the actual
entry, instead of "Male" which is how I wanted the heading to show up on the
report, unless I wanted to create another query).

I'm pretty new to Access, and admit to trying to use as many wizards as
possible. I completed a semester of SQL, which is helpful, sometimes. :).
 

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