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

modify grouping in aceess 1

Status
Not open for further replies.

erich13us

MIS
Feb 12, 2003
16
US
I have a report that groups client ages by 10's. How do I modify in to start art at 2 instead of zero?
 
Do you want 2..12..22..32..n2 or do you want 2 thru 10..20..30..n0
What is the expression you are currently using to group by.

Paul
 
The formula is int(min([AGE])/10)*10&"-"&((max([AGE])/10)+1)*10. I want to change the groups to 2-12 13-22 23-32 etc.
 
I wasn't sure how your expression was set up because you are using the min and max functions. Can you give me a little more detail how your query is set up. In the mean time I could get 2 - 11, 12 - 21, 22 - 31 or I could get 3 - 12, 13 - 22, 23 - 32 etc.
The basic expression is
(Int(([Age]-2)/10)*10)+2 & "-" & (Int(([Age]-2)/10)*10)+12

Let me know about your query and I'll look at it some more.

Paul
 
This is the query that I use to count the number of people at any given age.

SELECT DISTINCTROW [Client's Age].AGE, Count(*) AS [Count Of Client's Age]
FROM [Client's Age]
GROUP BY [Client's Age].AGE;
 
2 - 12 contains 11 year increments
13 - 22 and the rest on up contain 10 year increments. If you have to have 2 - 12 as the first group then you could use this:
SELECT [Client's Age].Age, Count([Client's Age].Age) AS Count Of Client's Age, IIf([Age]<=12,&quot;2-12&quot;,(Int(([Age]-2)/10)*10)+3 & &quot;-&quot; & (Int(([Age]-2)/10)*10)+12) AS Expr1
FROM [Client's Age]
GROUP BY [Client's Age].Age;

Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top