Received: from xserver.server (barco2.comcasttel.net [206.135.253.162]) by hub.org (8.10.1/8.10.1) with ESMTP id e7EI8Dw27351 for ; Mon, 14 Aug 2000 14:08:13 -0400 (EDT) Received: by XSERVER with Internet Mail Service (5.5.2650.21) id ; Mon, 14 Aug 2000 14:09:30 -0400 Message-ID: From: Henry Lafleur To: Web Manager , pgsql-sql@postgresql.org Subject: RE: select an entry with a NULL date field Date: Mon, 14 Aug 2000 14:09:08 -0400 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: text/plain; charset="iso-8859-1" X-Archive-Number: 200008/94 Comparing anything = NULL (if it would work) would always false, at least that's how other servers treat it. You have to use IS NULL. select entry_id from tbl_date where date_02 IS NULL; Henry -----Original Message----- From: Web Manager [mailto:web@inter-resa.com] Sent: Monday, August 14, 2000 9:03 AM To: pgsql-sql@postgresql.org Subject: [SQL] select an entry with a NULL date field Hello, I have a problem with PostgreSQL when I try to select or delete an entry with an empty date. That's a typical entry Table tbl_date ----------------------------- entry_id 154 date_01 2000-01-15 date_02 this date is NULL name my_test ----------------------------- I want to select every entry containing date_02 as NULL I tried : >select entry_id from tbl_date where date_02=NULL; ERROR: parser: parse error at or near "null" >select entry_id from tbl_date where date_02=''; Not work, that's a wrong date format >select entry_id from tbl_date where date_02=""; Not work, "" considered as an attribute Thank you for your time! -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Marc Andre Paquin