Click to See Complete Forum and Search --> : get rid of the expire date?


lyndon
11-27-2007, 08:40 PM
I have a field with date and a field with expiration number. I need to DELETE all items from the database wHich are expired or it has been months already, and then list them. If a expiration number is 31 I need all rows that are older that 31 days . So what would be my query?

NogDog
11-27-2007, 09:45 PM
DELETE FROM table_name WHERE DATE_SUB(CURDATE(), INTERVAL expiration_field DAYS) > date_field