Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2004
    Posts
    364

    Unanswered: Query / Report show age range totals?

    I have a query which displays the ages of people in my database (field name Age).

    I have a module linked to the query ( field name expr1) which lists the age range that these people fall into eg if they are aged 20 they fall into the 20-25 category.

    I have made a report of this query, but want to be able to show the total for each category eg 5 people in the 20-25 range, 3 people in the 26-30 range. I have 5 categories, so need 5 textboxes with code.

    How can I do this?

    Cheers

    Tom

  2. #2
    Join Date
    Sep 2004
    Location
    Tampa, FL
    Posts
    520
    I recently did something very similar. I used a series of IIF statements in a query to accomplish the task.

    For example.
    Code:
    SELECT Sum(IIf([Age] Between 12 And 17,1,0)) AS NumMatch17, Sum(IIf([Age] Between 18 And 25,1,0)) AS NumMatch25
    and so on.

    Hope that helps. .
    Darasen

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •