Date select question...

From: Lance Munslow <lance(dot)munslow(at)ttsltd(dot)com>
To: "'pgsql-sql(at)postgresql(dot)org'" <pgsql-sql(at)postgresql(dot)org>
Subject: Date select question...
Date: 2004-01-08 13:13:58
Message-ID: 1536369C345BD4118148000629C9833D57EAB5@nifty.preston.traveltech.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

I have the following table:

Table "public.test"
Column | Type | Modifiers
-----------+------+-----------
test_date | date |

with the following data:

test_date
------------
2004-10-31
2004-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-31
2004-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.

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Kaloyan Iliev Iliev 2004-01-08 14:00:15 Re: Start-up problems
Previous Message beyaRecords - The home Urban music 2004-01-08 12:59:36 Start-up problems