Click to See Complete Forum and Search --> : Check if datetime is null in MySql


Marlon_Br
05-28-2008, 02:13 PM
Hi, how do I check if a datetime field is null in a MySQL database?

I have a table that has a datetime field that I didn´t set a default value for it. So when nothing is filled into this field I imagine it has a default value of Null (not sure).

I´m trying this:

SELECT * FROM process WHERE date_inserted = null;

But it doesn´t work.

thanks

ss1289
05-28-2008, 03:03 PM
SELECT * FROM process WHERE date_inserted is null;

or to check if it's not null:

SELECT * FROM process WHERE date_inserted is not null;