age-categories

  • Thread starter Thread starter Jean-Paul De Winter
  • Start date Start date
J

Jean-Paul De Winter

Hi,
I have a table of about 4000 patients
all have a "date of birth"-field
It could be nice to know how many patients I have form
0 to 10 year
10 to 20
20 to 30
30 to 40
.......
I would like to get the results in %

Does anybody know how to do this?
Thanks
 
Hi,


Have a table that describes the groups:

FromAge, ToAge, GroupName
0 10 1
11 20 2
....


Then, use a query with an inner join:

----------------
SELECT groupName, COUNT(*)

FROM myTable INNER JOIN myGroupsAges
ON myTable.age BETWEEN myGroupsAges.FromAge TO myGroupsAges.ToAge

GROUP BY groupName
------------------


Alternatively, if the group is always in slices of 10 years, take a look at
PARTITION in the help file to get the result, with a Crosstab.



Hoping it may help,
Vanderghast, Access MVP
 
Back
Top