Re: How do you detect null date values in a SQL statement

From: Chris Daugherty <cmdaugherty_at_pier1.com>
Date: 1998/01/15
Message-ID: <34BE6612.601_at_pier1.com>#1/1


Chris Daugherty wrote:
>
> Can someone give me an example of a select statement that excludes a
> date or datetime that has a null ( or empty ) value? Please respond to
> my e-mail address : cmdaugherty_at_pier1.com
>
> Thanks
> Chris Daugherty

Thank you to everybody who responded to my question. Just so you don't think I'm a total idiot for asking that question, I'll show you why I asked.
I was trying to accomplish the above by doing this:

select count(*) from
load_provider where updated_date <> null; 

The above wouldn't work. It would not return anything. So, I assumed that the problem was with using the NULL constant. However, I was wrong. According to your responses, the following are the correct ways to write this ( for others who my be in my boat ) :

select count(*) from
load_provider where updated_date is not null; 

*OR*

select count(*) from
load_provider where updated_date != null; 

Thanks again for the help. Received on Thu Jan 15 1998 - 00:00:00 CET

Original text of this message