neophyte - 12:04 pm on Jul 14, 2012 (gmt 0)
Hello All -
I'm having trouble with a particular select and hoping someone here can help.
I'm selecting a table of information and want to order it by a timestamp field (fld_approved).
The trick that I'm trying to preform however is that I want the results sorted by the timestamp value of fld_approved + 3 days AND are LESS THAN the current time.
As mentioned, fld_approved contains an int timestamp (like 1342178312) and the 259200 shown below is 60*60*24*3 seconds (the seconds for 3 days).
What I've got now - which doesn't work at all - is:
ORDER BY fld_approved
WHERE (fld_approved + 259200) < UNIX_TIMESTAMP
LIMIT 0, 10";
I keep getting an error on the WHERE clause and can't figure out where I'm going wrong... or if I'm going about this query in the wrong way altogether.
Any guidance greatly appreciated.