View Single Post
Old 06-22-2005, 03:28 AM  
UnifiedStats_John
Confirmed User
 
Join Date: May 2005
Posts: 271
Quote:
Originally Posted by Danielle
Anyone know how to do this in mySQL?

I have a table with a datetime column and need to delete all entries that are older than 15 days.

Hugs,
Danielle
to view the data:
select * from tablename where datetime < DATE_ADD(now(), interval -15 day) order by datetime;

and if it looks right, to delete:
delete from tablename where datetime < DATE_ADD(now(), interval -15 day);
__________________

Last edited by UnifiedStats_John; 06-22-2005 at 03:30 AM..
UnifiedStats_John is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote