Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with mysql date functions

Status
Not open for further replies.

pwrlogic

Programmer
May 15, 2003
9
0
0
US
Hi
This should be easy
all i want to do is select all the records in a table greater than three days old.
select * from tableA where tablea.timestmp < current_timestamp - 3; does not work.
i'm stumped.
 
hi
thanks for the input
i found the solution though i do not know if it will work in both php and java sqlj/jdbc

SELECT *
FROM shopping_cart
where shopping_cart.timestmp
<= DATE_SUB(CURRENT_TIMESTAMP, INTERVAL &quot;3&quot; DAY)
order by shopping_cart.timestmp desc;
it works perfect.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top