Re: Dates and NULL's`

From: Richard Broersma <richard(dot)broersma(at)gmail(dot)com>
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 17:16:21
Message-ID: BANLkTina8jK3f_p0xynxgzQhpL2aCUsL6A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Tue, May 10, 2011 at 9:48 AM, John Fabiani <johnf(at)jfcomputer(dot)com> wrote:

> Where mydate >= "2011/04/01"::date and mydate<= "2011/04/30"::date
> With the above where will the NULL's be selected????

Here is what I get when I try:

spi=> SELECT NULL::DATE >= '2011-04-01'::DATE AND NULL::DATE <=
'2011-04-30'::DATE;
?column?
----------

(1 row)

spi=> SELECT (NULL::DATE >= '2011-04-01'::DATE AND NULL::DATE <=
'2011-04-30'::DATE) IS TRUE;
?column?
----------
f
(1 row)

spi=> SELECT (NULL::DATE >= '2011-04-01'::DATE AND NULL::DATE <=
'2011-04-30'::DATE) IS FALSE;
?column?
----------
f
(1 row)

spi=> SELECT (NULL::DATE >= '2011-04-01'::DATE AND NULL::DATE <=
'2011-04-30'::DATE) IS UNKNOWN;
?column?
----------
t
(1 row)

--
Regards,
Richard Broersma Jr.

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message John Fabiani 2011-05-10 17:24:23 Re: Dates and NULL's`
Previous Message Edward W. Rouse 2011-05-10 16:57:01 Re: Sorting Issue