A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

age-categories



 
 
Thread Tools Display Modes
  #1  
Old January 11th, 2006, 08:41 PM posted to microsoft.public.access.queries
external usenet poster
 
Posts: n/a
Default age-categories

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
  #2  
Old January 11th, 2006, 08:54 PM posted to microsoft.public.access.queries
external usenet poster
 
Posts: n/a
Default age-categories

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


"Jean-Paul De Winter" wrote in message
...
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



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sorting by categories problem Judy Contacts 2 April 26th, 2005 11:00 AM
Seperating common entries between different categories Steve Douglas Worksheet Functions 1 September 23rd, 2004 06:30 AM
Help on Customizing Views and sorting by Categories Judy Contacts 0 September 1st, 2004 10:57 PM
master categories list John Contacts 1 June 22nd, 2004 10:14 AM
Contact categories data blank - mismapping? Peter Lunn Contacts 1 May 18th, 2004 12:13 AM


All times are GMT +1. The time now is 07:19 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.