rashmi_k28 Posted August 13, 2008 Share Posted August 13, 2008 How to query for one day interval and exclude the seconds of timestamp If the current timestamp is $time='2008-08-13 14:00:02'; and if for the previous day for the 14hrs if the timestamp updated as '2008-08-13 14:00:01'. The data at the this '2008-08-12 14:00:01' is excluded when queried as below. So how to avoid it by using the query excluding seconds in the timestamp and considering only '2008-08-13 14:00' from the timestamp. select timestamp, fieldname from table where timestamp <= ('".$time."') and timestamp >= date_sub('".$time."',interval 1 day) order by timestamp Link to comment Share on other sites More sharing options...
fenway Posted August 13, 2008 Share Posted August 13, 2008 Don't double-post. Link to comment Share on other sites More sharing options...
Recommended Posts