Hi Frendz,
I have datetime field in database. now i want to filter out the record which are in today date using mysql query?

Recommended Answers

All 4 Replies

Sorry my date field is not datetime datatype. Its varchar.

Try this Query

SELECT date( date_time_field )
FROM DATA WHERE DATE( date_time_field) = DATE( NOW( ) )

Try this Query

SELECT date( date_time_field )
FROM DATA WHERE DATE( date_time_field) = DATE( NOW( ) )

Yes divyakrishnan, But this will work if the field is datetime datatype but mine is varchar.

this query solved my problem

SELECT * FROM `crm_callplan` WHERE substring( nextcall_datetime, 1, 10 ) = date( now( ) )
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.