Hi,

I have a field in my database (fieldName), of type DATETIME, which I populate using the NOW() function.

For example: 2012-04-09 13:53:48

I want to delete this record if 5 minutes have passed, ie 2012-04-09 13:58:48 or later.

The query I am using is:
Code:

DELETE FROM myTable WHERE DATE_ADD(NOW(), INTERVAL 5 MINUTE) > fieldName

But despite that more than 5 minutes have passed, the query still deletes zero rows.

Can anyone help me with writing the query correctly?

Many thanks for any help. :)



http://forums.masr.me