Re: Dates and NULL's`

From: Emi Lu <emilu(at)encs(dot)concordia(dot)ca>
To: John Fabiani <johnf(at)jfcomputer(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Dates and NULL's`
Date: 2011-05-10 20:16:34
Message-ID: 4DC99D22.5000004@encs.concordia.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

> if I have a date field that contains a NULL
> will it show up when I ask for a where date range for the same date field.
>
> Where mydate>= "2011/04/01"::date and mydate<= "2011/04/30"::date
>
> With the above where will the NULL's be selected????
>
> I ask because I was always told that a NULL matches everything and nothing!

I think the answer is no.

when mydate is null, record will not be returned.

e.g.,
select 'abc' where (null::date >='2011-01-01'::date) ;

0 rows returned.

Emi

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Brent Dombrowski 2011-05-10 20:33:12 Re: Dates and NULL's`
Previous Message Scott Marlowe 2011-05-10 17:56:56 Re: Sorting Issue