Jump to content

normalization age ranges options not sure of best approach


OldWest

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?

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.