rashmi_k28 Posted July 29, 2008 Share Posted July 29, 2008 How to find the records from current time to the 1 day interval excluding the seconds of the timestamp Link to comment https://forums.phpfreaks.com/topic/117143-1-day-interval/ Share on other sites More sharing options...
paul2463 Posted July 29, 2008 Share Posted July 29, 2008 have alook <A HREF="http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html"> Here at the MYSql Manual</A> SELECT something FROM tbl_name WHERE date_column = DATE_SUB(CURDATE(),INTERVAL 1 DAY) Link to comment https://forums.phpfreaks.com/topic/117143-1-day-interval/#findComment-602509 Share on other sites More sharing options...
rashmi_k28 Posted July 29, 2008 Author Share Posted July 29, 2008 select timestamp, ifnull(avg(100 - pkt),-1) from tablename where timestamp <= ('".$time."') and timestamp >= date_sub('".$time."',interval 1 day) group by timestamp; But I should include minutes and hour along with date. Now i am using the query like this Link to comment https://forums.phpfreaks.com/topic/117143-1-day-interval/#findComment-602537 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.