Its been a long day and I just can't get my head around this, perhaps I need some time out, but thought I'd post ehre to see if someone can make me see the lights!!
I have a DB with a Date Of Birth column (MySQL DATE), On the site in question I'm offering a search facility to find members within an AGE range - its not going to be perfect but it'll be fairly accurate, unless someone can suggest a better way.
So, I have two variables, DateRangeFrom, DateRangeTo, consisting of an age dropdown, from 16-80 years old.
Here's the WHERE clause I devised as a start, although it doesn't take into account the month/days, but it's a rough estimate based on the year alone but its bringing back everyone still, so I'm clearly doing something wrong, I jsut cannot get my head around it!!
WHERE (MemberDOB > DATE_SUB(CURDATE(),INTERVAL 56 YEAR) AND MemberDOB > DATE_SUB(CURDATE(),INTERVAL 63 YEAR))
Hopefully someone can help with a better solution?...and one that works lol!