954,587 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

how to check date from datetime field?

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

Karthik_pranas
Posting Pro
564 posts since Feb 2011
Reputation Points: 96
Solved Threads: 97
 

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

Karthik_pranas
Posting Pro
564 posts since Feb 2011
Reputation Points: 96
Solved Threads: 97
 

Try this Query

SELECT date( date_time_field )
FROM DATA WHERE DATE( date_time_field) = DATE( NOW( ) )
divyakrishnan
Posting Whiz in Training
201 posts since May 2010
Reputation Points: 30
Solved Threads: 24
 

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.

Karthik_pranas
Posting Pro
564 posts since Feb 2011
Reputation Points: 96
Solved Threads: 97
 

this query solved my problem

SELECT * FROM `crm_callplan` WHERE substring( nextcall_datetime, 1, 10 ) = date( now( ) )
Karthik_pranas
Posting Pro
564 posts since Feb 2011
Reputation Points: 96
Solved Threads: 97
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: