comparing dates in mysql database

Soldato
Joined
1 Mar 2003
Posts
5,508
Location
Cotham, Bristol
Ok the scenario is I have a column in one of my tables that has a date in the format DD/MM/YYYY, what I want to do is delete all rows from that table where this column is less than the current day (i.e. in the past).

How do I do this in SQL? (MySQL)
 
Is the column set as a DATE type or just plain text? I'd get it converted into DATE if it isn't.

You should then be able to do something like:

PHP:
SELECT * FROM TABLE WHERE DATE < NOW()
 
Back
Top Bottom