0

Hi,

I want to select all records from a table where the DateAdded field's date and time (Default value Timestamp field) is more than say 3 hrs ago.

eg: something like

SELECT tbldata.* FROM tbldata WHERE (tbldata.DateAdded <= now()-3);

I can get it working with days difference but do not seem to be able to get the hours difference.

If anyone can guide me along the right lines it would be appreciated.

regards

Steve

2
Contributors
2
Replies
13
Views
4 Years
Discussion Span
Last Post by richosr
0
SELECT tbldata.* FROM tbldata WHERE (tbldata.DateAdded <= DATE_SUB(now(), INTERVAL 3 HOUR));

Edited by pritaeas: Added markdown.

0

Many thanks for the speedy reply.

Much appreciated.

Steve

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.