I'm attempting to get everyone who has a birthday.
My code runs a SQL statement where it tries to grab the month and day from the age field.
when i do
WHERE age = '2000-01-30"'
It returns results
How do I return all results WHERE age = '01-30'
I tried stristr(age,'01-30')
and substr(age,5,5)
But both of those return nothing. So whats the correct way to do this?
Grabbing month/day out of a date field.
Moderator: General Moderators
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
Or you can do:
Mac
Code: Select all
WHERE DAYOFMONTH(age) = DAYOFMONTH(NOW()) AND MONTH(age) = MONTH(NOW())