Jump to content

normalization age ranges options not sure of best approach


Recommended Posts

i have a small query system i am working on.

 

simply put, when the form will run a query on several results, one of which is age. the age must be entered manually in a text field (on the user end when doing the search).

 

now. the results that output will be reliant on that age BUT there are age ranges.

 

for example, i have ranges of: 0-19, 20-24, over 65, under 65 etc and kind of random about this.

 

and if i enter the my age as 22 in the search field, positive matches would of course be 20-24 and under 65.

 

i have tables: product and age.

each product has an age range or a plus range (like over 65).

so all products would be returned that match the age entered (of course which products have a matching age_range_id)

 

i hope my question is clear. I am basically trying to resolve how my table relationship and structure should be to best accommodate this type of querying or a better solution altogether.

 

thanks for any advice

Store this as min/max values, with a text label.

 

Thanks for the tip. But I am not totally sure what you mean by min/max value and text label? Do you mean store the range in two separate text fields min and max?

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.