View Full Version : range


sadie
01-04-2006, 07:13 AM
I have a report with students ages ( 10, 11,12,13,14,etc)
I want to make a report angd have an age range like (0-10, 11-13,14-17 etc)
How is the best way to do this

ColinEssex
01-04-2006, 07:22 AM
Write a little Function() like this


AgeGrp(age)

If age < 10 Then
AgeGrp = "0 to 10"
ElseIf age < 13 Then
AgeGrp = "11 to 13"
ElseIf age < 17 Then
AgeGrp = "14 to 17"

etc etc
End If


Then in the querygrid put AgeGrp([Age]) as a field (I'm assuming you have a field called "age"

Col

sadie
01-04-2006, 07:45 AM
Thanks for your quick response
I do have a field called age but where do I put the code you wrote (sorry for my stupidity)

ColinEssex
01-04-2006, 07:55 AM
you're not stupid;)

you go into the modules part and write it there. Then you "call" that function via the query.

Col

sadie
01-04-2006, 12:46 PM
thanks, I'll try

~marie~
01-24-2006, 04:56 PM
hey sadie, did u get it? can u please tell me step by step how to do it? im having problem with that too. dont know how to call the function via query =S