Comparing dates

From: Markus Fischer <mfischer(at)josefine(dot)ben(dot)tuwien(dot)ac(dot)at>
To: pgsql-sql(at)postgresql(dot)org
Subject: Comparing dates
Date: 2001-03-06 12:33:23
Message-ID: 20010306133323.A3880@josefine.ben.tuwien.ac.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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(at)josefine(dot)ben(dot)tuwien(dot)ac(dot)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

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Boulat Khakimov 2001-03-06 14:14:54 Re: MySQLs Describe emulator!
Previous Message Karel Zak 2001-03-06 08:13:16 Re: No Documentation for to_char(INTERVAL, mask)