Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 698971337B4E for ; Tue, 10 May 2011 17:16:45 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 28519-04 for ; Tue, 10 May 2011 20:16:38 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from oldperseverance.encs.concordia.ca (oldperseverance.encs.concordia.ca [132.205.96.94]) by mail.postgresql.org (Postfix) with ESMTP id 406A11337990 for ; Tue, 10 May 2011 17:16:38 -0300 (ADT) Received: from cacao.encs.concordia.ca (emilu@cacao.encs.concordia.ca [132.205.47.225]) by oldperseverance.encs.concordia.ca (envelope-from emilu@encs.concordia.ca) (8.13.7/8.13.7) with ESMTP id p4AKGZQR002711; Tue, 10 May 2011 16:16:35 -0400 Message-ID: <4DC99D22.5000004@encs.concordia.ca> Date: Tue, 10 May 2011 16:16:34 -0400 From: Emi Lu Reply-To: emilu@encs.concordia.ca User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.16) Gecko/20101125 Lightning/1.0b1 Thunderbird/3.0.11 MIME-Version: 1.0 To: John Fabiani CC: pgsql-sql@postgresql.org Subject: Re: Dates and NULL's` References: <201105100948.41392.johnf@jfcomputer.com> In-Reply-To: <201105100948.41392.johnf@jfcomputer.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.58 on oldperseverance.encs.concordia.ca at 2011/05/10 16:16:35 EDT X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201105/71 X-Sequence-Number: 35355 > 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