Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Nov 2001
    Location
    Sydney, New South Wales, Australia
    Posts
    216
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Irregular Age Range Groups (Access 2003 SP2)

    I've been using the Partition function to setup age range groupings for graphing purposes but is there a way to create irregular age range groups, for example, 0-29, 30-39, 40-49, 50+?

    Many thanks

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Irregular Age Range Groups (Access 2003 SP2)

    You could use the Switch function:
    <code>
    Switch([Age]<30,"0-29",[Age]<40,"30-39",[Age]<50,"40-49",[Age]>=50,"50")
    </code>
    Switch takes a series of conditions - value pairs as argument, and returns the value corresponding to the first condition (starting from the left) that evaluates to true.

  3. #3
    3 Star Lounger
    Join Date
    Nov 2001
    Location
    Sydney, New South Wales, Australia
    Posts
    216
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Irregular Age Range Groups (Access 2003 SP2)

    Thanks Hans - great use of the Switch function!

Posting Permissions

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