Received: from ara.zf.jcu.cz (ara.zf.jcu.cz [160.217.161.4]) by mail.postgresql.org (8.11.3/8.11.1) with ESMTP id f2Q8wHw68627 for ; Mon, 26 Mar 2001 03:58:18 -0500 (EST) (envelope-from zakkr@zf.jcu.cz) Received: (from zakkr@localhost) by ara.zf.jcu.cz (8.9.3/8.9.3/Debian 8.9.3-21) id KAA22151; Mon, 26 Mar 2001 10:58:06 +0200 Date: Mon, 26 Mar 2001 10:58:06 +0200 From: Karel Zak To: waheed_rahuman Cc: pgsql-sql@postgresql.org Subject: Re: SQL Date help Message-ID: <20010326105806.C19983@ara.zf.jcu.cz> References: <20010325065031.26528.qmail@web1001.mail.yahoo.com> <00e001c0b5ce$21de96a0$660101c8@emirates.net.ae> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii User-Agent: Mutt/1.0.1i In-Reply-To: <00e001c0b5ce$21de96a0$660101c8@emirates.net.ae>; from waheed_rahuman@yahoo.com on Mon, Mar 26, 2001 at 12:24:07PM +0400 X-Archive-Number: 200103/516 X-Sequence-Number: 2187 On Mon, Mar 26, 2001 at 12:24:07PM +0400, waheed_rahuman wrote: > > > Hi, > > I am a newbie to SQL and postgresql too. > please guide me in the following... Any problem with documentation? > 1.How i can create date while i am inserting into the table ,in which the > field is date data type.(date should not be a current date and its should be > created > as in java date(int,int,int) INSERT INTO xxx VALUES (now()); INSERT INTO xxx VALUES ('2000-01-01'); > 2. How i can compare the date field. via standard operators, en example '<' '>' '=' 'between' ..etc. > For example , > how i can get the all the records between to two dates SELECT .... WHERE col BETWEEN '2000-01-01' AND '2001-01-01'; Please(!), see http://www.postgresql.org/users-lounge/docs/7.0/user/datatype.htm http://www.postgresql.org/users-lounge/docs/7.0/user/operators.htm http://www.postgresql.org/users-lounge/docs/7.0/user/operators2373.htm Karel -- Karel Zak http://home.zf.jcu.cz/~zakkr/ C, PostgreSQL, PHP, WWW, http://docs.linux.cz, http://mape.jcu.cz