Date select question... - Mailing list pgsql-sql

From Lance Munslow
Subject Date select question...
Date
Msg-id 1536369C345BD4118148000629C9833D57EAB5@nifty.preston.traveltech.co.uk
Whole thread Raw
Responses Re: Date select question...
List pgsql-sql
I have the following table:
    Table "public.test" Column   | Type | Modifiers
-----------+------+-----------test_date | date |

with the following data:
test_date
------------2004-10-312004-11-01
(2 rows)

Why does the query:

select * from test where test_date between '20041001' and '20041101';

return TWO rows:
test_date
------------2004-10-312004-11-01
(2 rows)

and the query:
select * from test where test_date between 20041001 and 20041101;test_date
------------2004-10-31
(1 row)

return just ONE row:
test_date
------------2004-10-31
(1 row)

regards,

Lance Munslow
Software Development
Travel Technology Systems Ltd

This Email may contain information of a confidential and/or privileged
nature.
The information transmitted is intended only for the benefit of the person
or entity to which it is addressed and must not be copied or forwarded
without the sender's express permission.
This Email does not reflect the views or opinions of Travel Technology
Systems Ltd.
This Email is without prejudice.
This Email does not constitute an agreement either explicitly or implicitly
with Travel Technology Systems Ltd.


pgsql-sql by date:

Previous
From: azwa@nc.com.my
Date:
Subject: data loading
Next
From: "Gregory S. Williamson"
Date:
Subject: Re: COPY command