Re: Age Group Calculation



On Aug 29, 12:48 am, Rose <R...@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
I would like count the number of clients in my table that fall into the
following age groups in my query or report. 62 and over, 51-61, 31-50,
18-30, 13-17, 6-12, 1-5, Under 1. I currently run 8 queries with the count
feature using Age Criteria changing each time and based off of the Birthdates
statement Age:((DateDiff("d",[Birthdate],Now())\365.25))). Any ideas on how
this can be done in one report if I display all clients and write
calculations on the bottom our report or somehow group them?
--
Rose

--
Rose

If you want to group/display your records by age group, change your
query like so:

select . . ., iif(Age < 1, "Group1", iif(Age<6, "Group2", iif(Age<18,
"Group3", iif(Age<31, "Group4", iif(Age<51, "Group5", iif(Age<62,
"Group6", "Group7")))))) as AgeGroup, . . .
from . . .


If all you want is the count of persons in an age group, add text
boxes to the report footer with control sources similar to:

=Sum(iif(Age<1, 1, 0))
=Sum(iif(Age>=1 and Age<=5, 1, 0))
=Sum(iif(Age>=6 and Age <=12, 1, 0))
.. . .


On a side note:
Does your data include any persons that were living during a year
divisible by 100, but not divisible by 400 (1800, 1900, 2100, etc.)?
If so, your formula for their age may not work correctly on/around
their birthday.

-Kris

.



Relevant Pages

  • Re: Do I need a Crosstab Query
    ... The record source for the report is a query that selects 6 data fields ... Judge from Twirlers_1.LastName Text ... so Level and Age Group appear to be on ...
    (microsoft.public.access.queries)
  • Access Report filtered with Chart
    ... Basically the query ... It I add a group section on Age Group to look at the data ... the graph (in the report footer) based off of a ... The SQL statement basically just groups the ...
    (microsoft.public.access.reports)
  • Re: MAX Value of similar but multiple fields
    ... You already have a Student table, ... Assuming that "1mile" means a race distance of 1 mile, ... In query design, drag the RaceTime field into the grid. ... Add the criteria to limit the age group. ...
    (microsoft.public.access.queries)
  • Re: Run a query for the system day
    ... >I am trying to run a report from a query to give me the birthday's for today ... The birthdates are entered in dd/mm/yyyy, ... How do I run the report based on ... Prev by Date: ...
    (microsoft.public.access.queries)
  • Re: Reporting Birthdays
    ... That won't work unless you are looking for birthdates of ... You need to limit your criteria to only look at the month and day. ... Using a query for your report in the DOB column criteria ...
    (microsoft.public.access.reports)