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

cant code non-sequential group intervals 1

Status
Not open for further replies.

brendanmc

Technical User
Nov 4, 2003
22
AU
I have a report where I need to group by age that are non standard, e.g. 0-17, 17-64 and 65+. currently I can set the age to every 1,5,10,15...(using standard access groupintervals) years but not with values that are non-sequential.

I imagine I could use multiple queries to do this or even sub-reports? But how to do it in the same report, I wouldn't have a clue.

For example, the report currently has the following.

0-10 years old
--------
location number of patients
a 30
b 22
c 33

11-20 years old
--------
location number of patients
a 17
b 62
c 13

What I need it to show is:

0-17 years old
----------
location number of patients
a 13
b 72
c 64

17-64 years old
------------
location number of patients
a 16
b 72
c 12


and so on.

I appreciate the help
Brendan
 
Guess you can play with the RecordSource of the Report

Add a new field in the Query for the Report

AgeGrp:iif([age]<17,1,iif([age]<65,2,3)
The result of theis Expression will be 1,2 or 3

Then group the report by this field

Best of luck

 
Thanks, this has worked a treat. I was definitely looking in the wrong spot.

Brendan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top