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

Database query need to subtotal subcategories 2

Status
Not open for further replies.

QUEENIE43951

Instructor
May 16, 2002
1
0
0
GB
Ok here is the problem
I have a full database, with columns for Age Gender and Ethnicity with various subcategories (male,female...white, chinese etc)
How can I subtotal the categories so that for example it shows me how many white females of a certain age there are and not just for the one subcategory but for all?
help would be gratefully received as I am at my wit's end
 
It is difficult without knowing the format of the report/form you are trying to create, but I would imagine that the various fields have unique values (i.e. "m" for male, "f" for female, "w" for white, etc.).

Have you used the natural grouping in reports or used the Dcount function e.g. dcount("[gender]","table","[gender]='f' and [race]='w'") as a subtotal. As a total dcount("[gender]","table",[gender]='f').

Let us know if you have additional questions or need more specific help
 
Use totals queries (the Sigma button at top. BTW greetings from Greece :) ). Group by subcategories and sum anything you want.
 
Just as more cook for this broth, if you want to COUNT sub categories within major categories, remember to use the field twice:

Group by Gender
count(male)
count(female)

Give you: M F
1 20

(ahhh. were it only so...:)

Group by Ethnicity
by Gender
Count(female)
Count(male)

Gives you:
Asian Caucasian African
Female=x Female: x Female:x
Male=yy Male: yy Male: yy

Place the VALUE to count ( "M", "F", "A", "C", etc etc) in the criteria field, and you're off and running.

Jim

How many of you believe in telekinesis? Raise my hand...
Another free Access forum:
More Access stuff at
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top