SUNIL16 Posted December 14, 2010 Share Posted December 14, 2010 Hi friends How to get data between two same dates my query is working for timestamp 00:00:00 below is my query SELECT ACTIVITY_TYPE,,date_format(ACTIVITY_DATE,'%Y/%m/%d') as logdate FROM activity_log WHERE ACTIVITY_DATE BETWEEN STR_TO_DATE('10/12/2010','%d/%m/%Y') and STR_TO_DATE('10/12/2010,'%d/%m/%Y') values in table type date a 10/12/2010 11:39:43 b 10/12/2010 13:39:43 c 10/12/2010 14:39:43 my above query will work and returns these 3 rows wen data is like this a 10/12/2010 00:00:00 b 10/12/2010 00:00:00 c 10/12/2010 00:00:00 but when time is there how to fetch data any ideas thanks sunil Link to comment https://forums.phpfreaks.com/topic/221620-how-to-get-data-between-two-same-dates-when-datefield-is-datetime/ Share on other sites More sharing options...
PFMaBiSmAd Posted December 14, 2010 Share Posted December 14, 2010 You need to just use the date part of ACTIVITY_DATE - ... WHERE DATE(ACTIVITY_DATE) BETWEEN ... Link to comment https://forums.phpfreaks.com/topic/221620-how-to-get-data-between-two-same-dates-when-datefield-is-datetime/#findComment-1147155 Share on other sites More sharing options...
SUNIL16 Posted December 14, 2010 Author Share Posted December 14, 2010 thank u sir, it solved my problem Link to comment https://forums.phpfreaks.com/topic/221620-how-to-get-data-between-two-same-dates-when-datefield-is-datetime/#findComment-1147166 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.