tags:

views:

55

answers:

2

Hi

I have a mysql database table with a column called task_end_date and task_name.

I want to select all the task_name from the table where the current date has passed task_end_date. How would i do that in mysql using an sql query.

Thanks

+2  A: 
SELECT
  x,y,z
FROM
  foo
WHERE
  task_end_date < Now()

Maybe you want Curdate() instead of Now().

VolkerK
+2  A: 
SELECT task_name FROM table WHERE curdate() > task_end_date

Note that curdate() as its name implies has no TIME component. If time really isn't important, then curdate() is the way to go, otherwise go with now().

karim79