
Originally Posted by
itischarles
Thanks for your reply. I have tried that before but it does not seem to work correctly. I have a db of products. These products have ages of people they apply to. an item can be worn by some one from ages 0 to 4, 3-8, 5-11, 0- 2, etc. when i search for an item that can be worn by people whose ages fall between 0 to 2, i expect to get the items : 0-4, 0-2 listed above.
However, i tried
select .. minage >= 0 and maxage <= 2
the 0-4 gets filtered out because the condition says <= 2.
any ideas
By the way
Code:
WHERE minAge < 2
AND maxAge > 0
gives you exactly what you asked for. In generic form:
Code:
WHERE minAge < $theMaxAgeUserInput
AND maxAge > $theMinAgeUserInput
Bookmarks