I am unclear how to write a query where I want all the entries in a specific month and date format from a MySQL table. I am not using DATE_FORMAT() with a NOW() correctly. I need to write a query that has a time field in the yyyy-mm-dd format to return all entries that match today’s month and date. I would appreciate your assistance.
Thanks
WBR

I should list what I have tried:
SELECT DATE_FORMAT(NOW(), '%M %D') returns "December 27th"

And

Select * from TIME_TABLE
Where
Extract(month from DATE_FIELD ) = 12
and
Extract(day from DATE_FIELD ) = 26
order by DATE_FIELD, DESCRIPTION

returns a result set, but

Select * from TIME_TABLE
Where
Extract(month from DATE_FIELD ) = DATE_FORMAT(NOW(), '%M')
and
Extract(day from DATE_FIELD ) = DATE_FORMAT(NOW(), '%D')
order by DATE_FIELD, DESCRIPTION

Returns an empty result set, so I think I need to figure out how to get the month and date as intergers.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.