dayang Posted May 15, 2009 Share Posted May 15, 2009 hello, i have question regarding how to search date.I have table name 'date' where the value is datetime.The problem is how to search date without time. please..please help me to solve it :'( Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted May 15, 2009 Share Posted May 15, 2009 http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_date Quote Link to comment Share on other sites More sharing options...
ldougherty Posted May 15, 2009 Share Posted May 15, 2009 So the entires in your database follow the format of YYYY-MM-DD HH:MM:SS for example 2009-05-10 11:12:13? And you want to search using just a date value of 2009-05-10? If that is indeed the case you can use the LIKE function when searching as such $date = '2009-05-10'; "SELECT * FROM date WHERE field LIKE '%$date%'" This will retrieve all values that include 2009-05-10 Quote Link to comment Share on other sites More sharing options...
dayang Posted May 15, 2009 Author Share Posted May 15, 2009 to ldougherty thanks for your code.it solve my problem..thanks again.. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.