I am trying to compare timestamps by finding out if particular timestamp field is greater than 15 days ago.
So if I try this on my database, I get:
SELECT DATE_SUB(NOW(), INTERVAL 15 DAY) // 2012-04-08 11:00:54
The field concerned has a value: 2012-04-20 21:18:14.
So when I try:
SELECT * FROM (`payments`) WHERE `LastUpdated` >= 'DATE_SUB(NOW(), INTERVAL 15 DAY)'
I get no rows returned? Am I comparing dates incorrectly?
You are treating the DATE_SUB function as a string.
Try this instead: