esmyhs
asked on
I need a MySQL Query to find anyone whose Birthday is today
I have a MySql Database with the following fields: First, Last, and DOB. (DOB is a Date Field.)
MySql requires the date to be in the following format: YYYY-MM-DD.
I am wondering if there is a SQL Query where I can return only those whose Birthdays are today, regardless of what year they were born.
Thanks
MySql requires the date to be in the following format: YYYY-MM-DD.
I am wondering if there is a SQL Query where I can return only those whose Birthdays are today, regardless of what year they were born.
Thanks
select ------ from table where date_field = CURDATE();
ASKER
Correct me if I'm wrong, but this query won't automatically figure out today's date, will it?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
theGhost_k8:
The Date in the table is the Date Of Birth. If I understand you correctly, CURDATE() won't find it because the years will be different.
The Date in the table is the Date Of Birth. If I understand you correctly, CURDATE() won't find it because the years will be different.
it won't ... mistakes in hurry...
Did you try mine???
Ah yes, the CURDATE() is a nice touch. I need to brush up on my MySQL =)
ASKER
You guys are way too quick. Thanks for all the help. This one did it.
Open in new window