Ok, I have the following Users table:
id | name | birthday
1 | nam1 | 1980-06-29
2 | nam2 | 1997-07-08
3 | nam3 | 1997-07-20
Assuming that today is 2012-06-29
How can I get the users who will celebrate your birthdays in the next 15 days? I have tried with this:
select * from users where birthday between '%-06-29' and '%-07-14';
but looks like is not a valid query.
I think the safest way is to compare their age in 15 days with their age today:
See it on sqlfiddle.