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 :'( Link to comment https://forums.phpfreaks.com/topic/158212-search-date/ 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 Link to comment https://forums.phpfreaks.com/topic/158212-search-date/#findComment-834507 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 Link to comment https://forums.phpfreaks.com/topic/158212-search-date/#findComment-834508 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.. Link to comment https://forums.phpfreaks.com/topic/158212-search-date/#findComment-834512 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.