Received: from chello213047128070.15.vie.surfer.at ([213.47.128.70]) by mail.postgresql.org (8.11.1/8.11.1) with SMTP id f26CbMx70126 for ; Tue, 6 Mar 2001 07:37:46 -0500 (EST) (envelope-from mfischer@josefine.ben.tuwien.ac.at) Received: (qmail 15463 invoked by uid 1000); 6 Mar 2001 12:33:23 -0000 Date: Tue, 6 Mar 2001 13:33:23 +0100 From: Markus Fischer To: pgsql-sql@postgresql.org Subject: Comparing dates Message-ID: <20010306133323.A3880@josefine.ben.tuwien.ac.at> Mail-Followup-To: Markus Fischer , pgsql-sql@postgresql.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.15i X-Editor: Vim http://www.vim.org/ X-Url: http://josefine.ben.tuwien.ac.at/~mfischer/ X-Factor: Area 51 X-PGP-Key: 0xC2272BD0 at pgp.ai.mit.edu X-PGP-Fingerprint: D3B0 DD4F E12B F911 3CE1 C2B5 D674 B445 C227 2BD0 X-Archive-Number: 200103/91 X-Sequence-Number: 1739 Hello, I've a SELECT statement on many joined Tabled and one of them has a date column called 'date_date'. When I fetch a date e.g. '02-03-2001', I get, say, 60 results back. When I now perform the same query with another date, lets take '03-03-2001', I get back about 70 results. When I now modify my query to get both results in one I write SELECT .... FROM .. AND date_date >= '2001-03-02' AND date_date <= '2001-03-03' AND .... I think I should get back the rows for both days, 60 + 70 makes 130 to me. But what I get back is even smaller then 60. I allready tried TO_DATE conversion, an OR construct but always the same result. Is there something special to know when comparing/working with date-datetypes ? kind regards, Markus -- Markus Fischer, http://josefine.ben.tuwien.ac.at/~mfischer/ EMail: mfischer@josefine.ben.tuwien.ac.at PGP Public Key: http://josefine.ben.tuwien.ac.at/~mfischer/C2272BD0.asc PGP Fingerprint: D3B0 DD4F E12B F911 3CE1 C2B5 D674 B445 C227 2BD0