If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Count ages in footer
Using Access 2003 in the detail section of a report I am counting the number
of people who are each age, such as age 70, 20 people; age 69, 24 people, etc. the age range is 23 - 97 in the report. Now in the footer I want to total the number of people who are = 25, 25 - 40, 40 - 55 and =55. I have tried the following =IIf([Age]=25,Sum([CountOfAge])," ") but getting an incorrect total for the number of people who are less than or equal to age 25. I have tried the following for 25 - 40, =IIf([age]25 And [age]=40,Sum([CountofAge])," ") and again getting an incorrect total. What do you suggest? |
#2
|
|||
|
|||
Count ages in footer
I think it would be a mistake to hard-code the age values into an expression.
Consider creating a table of age ranges with FromAge, ToAge, and Title. Yo ucan then create a totals query based on this table and your table with the age (or DOB). Use this new totals query as the record source of a subreport. -- Duane Hookom Microsoft Access MVP "Basenji" wrote: Using Access 2003 in the detail section of a report I am counting the number of people who are each age, such as age 70, 20 people; age 69, 24 people, etc. the age range is 23 - 97 in the report. Now in the footer I want to total the number of people who are = 25, 25 - 40, 40 - 55 and =55. I have tried the following =IIf([Age]=25,Sum([CountOfAge])," ") but getting an incorrect total for the number of people who are less than or equal to age 25. I have tried the following for 25 - 40, =IIf([age]25 And [age]=40,Sum([CountofAge])," ") and again getting an incorrect total. What do you suggest? |
#3
|
|||
|
|||
Count ages in footer
The following MIGHT WORK, but you might get an error message also.
=Sum(IIF(Age=25,CountOfAge,0)) John Spencer Access MVP 2002-2005, 2007-2009 The Hilltop Institute University of Maryland Baltimore County Basenji wrote: Using Access 2003 in the detail section of a report I am counting the number of people who are each age, such as age 70, 20 people; age 69, 24 people, etc. the age range is 23 - 97 in the report. Now in the footer I want to total the number of people who are = 25, 25 - 40, 40 - 55 and =55. I have tried the following =IIf([Age]=25,Sum([CountOfAge])," ") but getting an incorrect total for the number of people who are less than or equal to age 25. I have tried the following for 25 - 40, =IIf([age]25 And [age]=40,Sum([CountofAge])," ") and again getting an incorrect total. What do you suggest? |
Thread Tools | |
Display Modes | |
|
|