Received: from anchor-post-31.mail.demon.net (anchor-post-31.mail.demon.net [194.217.242.89]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f34KF1890708 for ; Wed, 4 Apr 2001 16:15:02 -0400 (EDT) (envelope-from olly@lfix.co.uk) Received: from lfix.demon.co.uk ([158.152.59.127] helo=linda.lfix.co.uk) by anchor-post-31.mail.demon.net with esmtp (Exim 2.12 #1) id 14ktgA-000JJN-0V; Wed, 4 Apr 2001 21:14:58 +0100 Received: from lfix.co.uk (olly@localhost [127.0.0.1]) by localhost (8.11.3/8.11.3/Debian 8.11.2-1) with ESMTP id f34KEua13126; Wed, 4 Apr 2001 21:14:57 +0100 Message-Id: <200104042014.f34KEua13126@linda.lfix.co.uk> X-Mailer: exmh version 2.3.1 01/18/2001 (debian 2.3.1-1) with nmh-1.0.4+dev X-URL: http://www.lfix.co.uk/oliver X-face: "xUFVDj+ZJtL_IbURmI}!~xAyPC"Mrk=MkAm&tPQnNq(FWxv49R}\>0oI8VM?O2VY+N7@F- KMLl*!h}B)u@TW|B}6 cc: pgsql-sql@postgresql.org Subject: Re: searching for dates In-reply-to: Message from Birgit Jansen of Wed, 04 Apr 2001 20:27:01 BST. <3ACB7584.F46EAD37@eCoNeed.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 04 Apr 2001 21:14:56 +0100 From: "Oliver Elphick" X-Archive-Number: 200104/57 X-Sequence-Number: 2396 Birgit Jansen wrote: >I am trying to select from a table all rows that have a date befor >1/1/2001 or after some date >I am not sure how to do it. >I try >select date_part('year', start_date) from sometable; >and that works but how do I get it to only show me the years between >1990 and 2001 or some >othere set of dates. > >I would realy like to be able to just have a function to tell me if a >date in my datebase is >befor or after a date? SELECT * FROM table WHERE start_date BETWEEN '1990-01-01' AND '2001-12-31'; -- Oliver Elphick Oliver.Elphick@lfix.co.uk Isle of Wight http://www.lfix.co.uk/oliver PGP: 1024R/32B8FAA1: 97 EA 1D 47 72 3F 28 47 6B 7E 39 CC 56 E4 C1 47 GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C ======================================== "Thou will keep him in perfect peace, whose mind is stayed on thee, because he trusts in thee." Isaiah 26:3