Age Range Query

edojan

Registered User.
Local time
Yesterday, 17:44
Joined
Dec 19, 2006
Messages
26
ok here is whats in my table

Document ID
UserName
Age

I need to have grouped UserName, Total count of DocumentID.
Then i need to have age range count between 0 and 5, 10 and 15, 20+ ....
basically, Username , Total DocumentID count for User, Range Count (0-5,10-15....)

Thanks
 
I don't understand how you can have an age range count for each user.
You can put each user into a range using IIF statements but what does that achieve?

Brian
 
Well for each user i need to count # of time age lets say between 0-5 occurs.
so user a has total of 5 count/occurrences for 0-5 range and another 10 occurrences for 5-10 range ... does this make sense?


I don't understand how you can have an age range count for each user.
You can put each user into a range using IIF statements but what does that achieve?

Brian
 
My mistake I was thinking age applied to user but of course its the document:o
You will need as many fields as nescessary in the query of the form
Sum(IIf([age]<=5,"1")) AS age0_5, Sum(IIf([age]>5 And [age]<16,"1")) AS age6_15, etc

Brian
 
THANKS!!!

WORKED GREAT!

had to do minor mod to : Abs(Sum(IIf([AGE]>5 And [age]<16,True))) but worked like a charm! thank you!

My mistake I was thinking age applied to user but of course its the document:o
You will need as many fields as nescessary in the query of the form
Sum(IIf([age]<=5,"1")) AS age0_5, Sum(IIf([age]>5 And [age]<16,"1")) AS age6_15, etc

Brian
 
Ah!, I've just noticed I put the 1 in "" making it text, that may have caused a problem :o , guess its too late for an old guy to be thinking :D

Brian
 

Users who are viewing this thread

Back
Top Bottom