Re: Between and miliseconds (timestamps) - Mailing list pgsql-sql

From Ezequias Rodrigues da Rocha
Subject Re: Between and miliseconds (timestamps)
Date
Msg-id 55c095e90611120603u1e4ca141qe11335fbd96ce181@mail.gmail.com
Whole thread Raw
In response to Re: Between and miliseconds (timestamps)  (Joe <dev@freedomcircle.net>)
List pgsql-sql
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/

pgsql-sql by date:

Previous
From: Joe
Date:
Subject: Re: Between and miliseconds (timestamps)
Next
From: "Marko Rihtar"
Date:
Subject: SQL - update table problem...