02-08-2008, 04:21 PM
|
#3 (permalink)
|
|
The Addict
Join Date: Jan 2008
Location: USA
Posts: 217
Thanks: 16
|
sql Code:
SELECT * FROM `my_table` WHERE TIME_TO_SEC(TIME()) - TIME_TO_SEC(`access`) < (60*60*24);
Unless I'm mistaken, or have mistyped something, I'm sure this is what you're after. The timestamps are stored in seconds, though not a strictly integer format mind you, so convert to seconds and compare the difference. This won't work for times in the future versus the current time though, as they'll always turn out to be negative.
__________________
Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while the Universe is trying to create bigger and better idiots. So far the Universe is winning. - Rich Cook
|
|
|
|