I have seen so question in this site; but they are just giving birthday data only not giving count like: mysql query to get birthdays for next 10 days
Here what I want is birthday count for each day for upcoming next 9 days and from 2 days after: for example today is 03-18 so i want to send data of 03-20 to 03-26
Here is my query
SELECT count(DOB) as count,DAYOFMONTH(DOB) as day
from patient
where
day(DOB) >= day(DATE_ADD(CURDATE(), interval 2 day))
and day(DOB) < day(DATE_ADD(CURDATE(), interval 9 day))
and month(DOB) < month(DATE_ADD(CURDATE(), interval 1 month))
group by day
ORDER BY day ASC
it is giving output like:
count date
2444 03-20
2337 03-21
2354 03-22
2064 03-23
2118 03-24
2357 03-25
2181 03-26
But it is not correct as per I query where DOB LIKE '%-03-20' the count is different.
Thank you in advance.