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

Need Help With Query Grouping question

Status
Not open for further replies.

SherryLynn

Technical User
Feb 4, 2001
171
CA
I have a query with two fields;
Field: AgeYears Total: AgeYears
Total: Group By Count

The Total:AgeYears column counts the number of individuals who are in each age group (ie. 3-2yr. olds, 4-10yr. olds, 1-1yr. old, etc.) On my report where I need to add this information, I need to group the ages into categories:

Under 1 year (<1)
1-3 yrs.
4-10 yrs.
11-15 yrs.
16 and over (>16)

How can I best achieve this? I tried putting a text box on the report with the following function -
=Sum([AgeYears]>0 And [AgeYears]<4) (for the 1-3 yrs. group). This gives me the right number of individuals, but it gives it a negative value (ie. -6 rather than 6). What have I done wrong? Or how can I write/add something to the query to group these for me? Help.

Thanks, Sherry
 
Sherry,
you can add the calculations to the criteria field in the query instead of putting the calculations in the report. I am not sure that this will solve your problem but you might
try something like
=Sum([Age Years] Between 0 and 4)
I am not sure that is the right syntax but I think the expression Between might be the answer here.
Sera
 
Between 0 and 3 (0 and 3 will be inclusive). Mary :)

Rule 1: Don't sweat the small stuff.
Rule 2: EVERYTHING is small stuff!! X-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top