Received: from kss.net.au ([203.41.122.41]) by hub.org (8.10.1/8.10.1) with ESMTP id e6H23g090637 for ; Sun, 16 Jul 2000 22:03:43 -0400 (EDT) Received: from kss.net.au (coco [10.10.1.9]) by kss.net.au (8.8.7/8.8.7) with ESMTP id MAA17926 for ; Mon, 17 Jul 2000 12:06:03 +1000 Message-ID: <39726A5C.B6B45856@kss.net.au> Date: Mon, 17 Jul 2000 12:07:25 +1000 From: Carolyn Lu Wong X-Mailer: Mozilla 4.7 [en] (WinNT; I) X-Accept-Language: en MIME-Version: 1.0 To: "pgsql-sql@postgresql.org" Subject: SQL question Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200007/161 I have table with the following definition: create table table1( account_no int4, start_date_tme datetime .... ); The table may contain null values for start_date_time. When I run the following SQL query, it fails: select * from table1 where start_date_time::date >= '01/01/2000'::date and start_date_time::date <= '01/01/2001'::date; I get error message 'Unable to convert null datetime to date. It's fine if I run the same SQL query with added condition as follows: select * from table1 > where account_no = 1 and start_date_time::date >= '01/01/2000'::date and start_date_time::date <= '01/01/2001'::date; Is this a bug? Or there's an logical explaination for this?