pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ezequias Rodrigues da Rocha <ezequias.rocha@gmail.com>
To: Joe <dev@freedomcircle.net>
Cc: A. Kretschmer <andreas.kretschmer@schollglas.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Between and miliseconds (timestamps)
Date: Sun, 12 Nov 2006 12:03:30 -0200
Message-ID: <55c095e90611120603u1e4ca141qe11335fbd96ce181@mail.gmail.com> (raw)
In-Reply-To: <1163199650.682.9.camel@pampa>
References: <55c095e90611100628m1322eea5jeeca3a94d90e1eb1@mail.gmail.com>
	<20061110144458.GA2909@a-kretschmer.de>
	<55c095e90611100650q3ec0ec27tc0f8e94a0eb032eb@mail.gmail.com>
	<20061110152427.GA3634@a-kretschmer.de>
	<55c095e90611101034r7dc6bf1btba72aa24f9300593@mail.gmail.com>
	<1163199650.682.9.camel@pampa>

Great Joe. That is what I want.

Now I can do a simple select (with between) statement.

Now my query that works is:

select * from base.tb1
where date(tm) between '2006-09-05' and '2006-09-06'
order by 1

Thank you very much Joe


2006/11/10, Joe <dev@freedomcircle.net>:
>
> Hi Ezequias,
>
> On Fri, 2006-11-10 at 16:34 -0200, Ezequias Rodrigues da Rocha wrote:
> > Ok thank you very much, but the suggestion (SQL:when field =
> > '2006-09-06'::date) does not retrieve any row. It does not retrive any
> > error too, but the suggestion does not applied to my requisition.
>
> I think you want to cast the field, not the constant, e.g.,
>
> testdb=> select * from t2 where date(tm) = '2006-9-6';
>               tm
> -------------------------------
> 2006-09-06 00:00:01-04
> 2006-09-06 23:59:59.999999-04
> (2 rows)
>
> Joe
>
>


-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
                                  Atenciosamente (Sincerely)
                        Ezequias Rodrigues da Rocha
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
A pior das democracias ainda é melhor do que a melhor das ditaduras
The worst of democracies is still better than the better of dictatorships
http://ezequiasrocha.blogspot.com/

view thread (6+ messages)

Message-ID: <55c095e90611120603u1e4ca141qe11335fbd96ce181@mail.gmail.com>
Permalink:  ../55c095e90611120603u1e4ca141qe11335fbd96ce181@mail.gmail.com/
Also on:    postgresql.org/message-id/55c095e90611120603u1e4ca141qe11335fbd96ce181@mail.gmail.com

 · 

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: ezequias.rocha@gmail.com, dev@freedomcircle.net, andreas.kretschmer@schollglas.com
  Subject: Re: Between and miliseconds (timestamps)
  In-Reply-To: <55c095e90611120603u1e4ca141qe11335fbd96ce181@mail.gmail.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