I guess I should start by saying I'm a beginner in Access. I have enough knowledge to be a menace. Not a threat or a danger, just enough to stir up trouble.
I have a membership database. In this I want to group the children by their ages and gender. Ages can range from 1 month to 17+ years. I used this statement
IIf(DateDiff("m",[BDay],Date())<12,DateDiff("m",[BDay],Date()),DateDiff("yyyy",[BDay],Date())+Int(Format(Date(),"mmdd")<Format([BDay],"mmdd"))) to get the age. field name:[Age]
In a separate text box I used this statement IIf(DateDiff("m",[BDay],Date())<12,"mth"," yr") to indicate whether the age was in months or years. field name:[Mth Yr] So far (I think) this will work for me.
What I would like to do is create the following age ranges to group the kids:
1-12 months, group 1
2-4 years, group 2
5-7 years, group 3
8-10 years, group 4
11-13 years, group 5
14-17 years, group 6
18+ years, group 7.
I have a column in my query that calculates the age. I also have a column for the month year text. I made separate columns in the query for the groups, but I don't think this will work when I want to group them on the report. I could do an iif statement, but I need to have a 2 part expression. Like if [Age] is <12 and [Mth Yr] = "mth" then put a 1. Every number below 12 could be the age in months or years. I don't want to group 3 month old kids with 3 year old kids.
Please help.I've been playing with this for 2 days.
Candace