pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ramil G. Sagum <ramil@astra.ph>
To: pgsql-sql@postgresql.org
Subject: Re: select date range?
Date: 17 Jun 2003 11:43:47 +0800
Message-ID: <1055821427.29605.53.camel@arwen.hq.astra.ph> (raw)
In-Reply-To: <02c101c3347c$1279d830$c9641cac@myko>
References: <02c101c3347c$1279d830$c9641cac@myko>

hmm it should work fine. Remember, the statement

....where mydate between '2003/05/12' and '2003/06/17'

would ONLY return records from '2003/05/12 to 2003/06/16 since your type
is a timestamp. 2003/06/17 actually means 2003/06/17 00:00:00.000000+00.
so a timestamp of 2003/06/17 03:01:10.102022+08 would not be included in
the query.


got it?

ramil


On Tue, 2003-06-17 at 10:56, ko wrote:
> Hi,
>  
> When I use sql statement to select the date range from $_POST value,It
> doesn't work.
>  
> -------------------------------------------
> "select * from mydatabase where mydate between '$_POST[start_date]'
> and '$_POST[end_date]' "
>  
> There is no error,but the result is not I want.
>  
> ps:
> (1)mydate attribute is timestamp
> (2)$_POST[start_date] is something like '2003/05/12'
>  




view thread (4+ messages)  latest in thread

Message-ID: <1055821427.29605.53.camel@arwen.hq.astra.ph>
Permalink:  ../1055821427.29605.53.camel@arwen.hq.astra.ph/
Also on:    postgresql.org/message-id/1055821427.29605.53.camel@arwen.hq.astra.ph

 · 

reply

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: ramil@astra.ph
  Subject: Re: select date range?
  In-Reply-To: <1055821427.29605.53.camel@arwen.hq.astra.ph>

* 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