Received: from tidal.ipinc.com (tidal.ipinc.com [199.245.188.85]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f1GLjlx70040 for ; Fri, 16 Feb 2001 16:45:47 -0500 (EST) (envelope-from jliang@tidal.ipinc.com) Received: from localhost (jliang@localhost) by tidal.ipinc.com (8.9.3/8.9.3) with ESMTP id NAA70960; Fri, 16 Feb 2001 13:45:26 -0800 (PST) (envelope-from jliang@tidal.ipinc.com) Date: Fri, 16 Feb 2001 13:45:26 -0800 (PST) From: Jie Liang To: Mark Byerley cc: pgsql-sql@postgresql.org Subject: Re: Datetime Query In-Reply-To: <5.0.2.1.0.20010215102652.00a140a0@admmail.uwaterloo.ca> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200102/295 X-Sequence-Number: 1489 Try: SELECT request_no FROM request where status_code ='C' and (completed_date::date between '01/01/2000'::date and '01/01/2001'::date) actually date('01/01/2000') does same thing as '01/01/2000'::date Jie LIANG St. Bernard Software Internet Products Inc. 10350 Science Center Drive Suite 100, San Diego, CA 92121 Office:(858)320-4873 jliang@ipinc.com www.stbernard.com www.ipinc.com On Thu, 15 Feb 2001, Mark Byerley wrote: > I need to create a query which will select a request_no between Data1 and > Date2 so... > > SELECT request_no FROM request where status_code ='C' and (completed_date > between 01/01/2000 and 01/01/2001); > > The problem I have run into is that the completed_date field is a datetime > format (not by my own design) and I am having some problems extracting just > the request_no's between those dates. > I have tried a few extract month,day,year clauses with no success. If > anyone has an idea I would appreciate it! > Thanks in advance. > Mark >