From: Theodore Petrosky <tedpet5@yahoo.com>
To: postgres SQL <pgsql-sql@postgresql.org>
Subject: question using 'between' in a sql query
Date: Sat, 3 Dec 2005 09:54:16 -0800 (PST)
Message-ID: <20051203175416.31456.qmail@web31712.mail.mud.yahoo.com> (raw)
My table
create table mytable (
employeecode text,
info text,
somestuff text,
insertdate timestamp with time zone);
I have an interface where the user can query for all
employeecode between two dates. I assumed from the
docs that:
SELECT employeecode FROM mytable WHERE insertdate
BETWEEN '11/20/2005' AND '11/20/2005'
would yield an inclusive result set. I am being lazy
and I didn't want to check if the user was looking for
just one day.... (it looks like I will have to not be
lazy).
Is this correct behavior? if 'between' is inclusive of
the start and end dates why doesn't this query result
in all the rows on '11/20/2005'?
BTW this is 8.1 on OS X 10.4.3
Ted
__________________________________________
Yahoo! DSL – Something to write home about.
Just $16.99/mo. or less.
dsl.yahoo.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: tedpet5@yahoo.com
Subject: Re: question using 'between' in a sql query
In-Reply-To: <20051203175416.31456.qmail@web31712.mail.mud.yahoo.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox