Simple Query Will Not Work

I am trying to write a simple query to return all rows with a certain 'Null' value.  The select statement works but not the where statement.  The query is the following:

Select * from tblCsEventReminders
where CompletedDate = NULL

The where statement returns no data without errors even though I see 'Null' in the column. I included properties of the column. I am not sure if that will help.

August 23rd, 2015 9:44pm

Select * from tblCsEventReminders
where CompletedDate = NULL

To check for NULL, use "IS NULL" rather than "= NULL".  Otherwise, the result is unknown rather than the expected true or false.

SELECT *
FROM dbo.tblCsEventReminders
WHERE CompletedDate IS NULL;

Free Windows Admin Tool Kit Click here and download it now
August 23rd, 2015 9:56pm

hi Kurt,

think I have figured it - you need to do this instead:

where CompletedDate is NULL

cheers

dan

August 23rd, 2015 9:56pm

Thank you!

Free Windows Admin Tool Kit Click here and download it now
August 23rd, 2015 9:59pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics