I need some help here. I have a table which stores DateOf Birth . I used DateDiff to get the age of persons but what I need is a number of persons within certain age range (0-15, 15-30, 30-50, 50>). How should I get that?
I typically use a formula to convert what I want to know, and then create filters around that. For example, it's good that you're using DateDiff to figure out the age, but you need to create another query on top of that to make a condition. This condition could be linked to a table or form, or a form controlled by a table if you wish; we'll call it "Age Prompt" as an example. The condition in your new query should look like this:
Code:
[B]Criteria:[/B] Between [Forms]![Age Prompt]![AgeRange1] And [Forms]![Age Prompt]![AgeRange2]
I need some help here. I have a table which stores DateOf Birth . I used DateDiff to get the age of persons but what I need is a number of persons within certain age range (0-15, 15-30, 30-50, 50>). How should I get that?
What didn't work? The code I listed should have allowed you to create a query with the age range for each person. If you can't group by that column, then save that as an interim query and create a new query based on the interim query that groups on the range. However, this will give you a layout like this: