Received: from cvrc.mgh.harvard.edu (root@cvrc.mgh.harvard.edu [132.183.120.19]) by hub.org (8.9.3/8.9.3) with ESMTP id RAA07293 for ; Tue, 16 Nov 1999 17:58:11 -0500 (EST) (envelope-from ziniti@helix.mgh.harvard.edu) Received: from helix.mgh.harvard.edu (ziniti@cvrc-trout.mgh.harvard.edu [132.183.120.75]) by cvrc.mgh.harvard.edu (8.9.3/8.9.3) with ESMTP id RAA32462 for ; Tue, 16 Nov 1999 17:58:09 -0500 (EST) (envelope-from ziniti@helix.mgh.harvard.edu) Sender: ziniti@cvrc.mgh.harvard.edu Message-ID: <3831E181.621187B9@helix.mgh.harvard.edu> Date: Tue, 16 Nov 1999 17:58:09 -0500 From: John Ziniti X-Mailer: Mozilla 4.61 [en] (X11; I; FreeBSD 3.2-STABLE i386) X-Accept-Language: en MIME-Version: 1.0 To: SQL Subject: Re: [SQL] Updating datetime fields with NULL values References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hey Gary, Use the keyword NULL as your value: pipeline=> create table testme (datetimetest datetime); CREATE pipeline=> insert into testme (datetimetest) values ('now'); INSERT 1509043 1 pipeline=> select * from testme; datetimetest ---------------------------- Tue Nov 16 17:56:09 1999 EST (1 row) pipeline=> update testme set datetimetest=NULL; UPDATE 1 pipeline=> select * from testme; datetimetest ------------ (1 row) Gary MacMinn wrote: > > Morning All, > > Is it possible to clear a datetime field to NULL? If so, how? In trying an update (update test set d1='' where t1='Text2';) I get an error of Bad datetime external representation '' > > TIA, > Gary MacMinn > =============================================== > Table = test > +----------------------------------+----------------------------------+-------+ > | Field | Type | Length| > +----------------------------------+----------------------------------+-------+ > | t1 | text | var | > | d1 | datetime | 8 | > +----------------------------------+----------------------------------+-------+ > > ************ -- John Ziniti Mass General Hospital CVRC 149-4201 149 13th Street Charlestown, MA 02129 tel (617) 726-4347 fax (617) 726-5806 ziniti@helix.mgh.harvard.edu