Received: from localhost (uranus.hub.org [200.46.204.60]) by postgresql.org (Postfix) with ESMTP id B4C739FB1D4 for ; Sun, 12 Nov 2006 10:03:34 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.60]) (amavisd-new, port 10024) with ESMTP id 98347-05 for ; Sun, 12 Nov 2006 10:03:33 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.168]) by postgresql.org (Postfix) with ESMTP id 832979FA0FE for ; Sun, 12 Nov 2006 10:03:33 -0400 (AST) Received: by ug-out-1314.google.com with SMTP id k3so732254ugf for ; Sun, 12 Nov 2006 06:03:31 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=MycqG+z3NI5DPtvnt0him78b4R96Uagg5M8s5X3EKeCX9mLeXw2a/8cJMo7inepcsUUpSYIBC3nD146wtxIrX97mxlvBdFHuyIRnrBKeZEzgR/xyswR8q7g6T39J/FK/dRVhbQ52sQU507KbKR1egrDOwDHCP4TqeT84Nd7AftM= Received: by 10.67.100.17 with SMTP id c17mr6455605ugm.1163340210954; Sun, 12 Nov 2006 06:03:30 -0800 (PST) Received: by 10.67.118.11 with HTTP; Sun, 12 Nov 2006 06:03:30 -0800 (PST) Message-ID: <55c095e90611120603u1e4ca141qe11335fbd96ce181@mail.gmail.com> Date: Sun, 12 Nov 2006 12:03:30 -0200 From: "Ezequias Rodrigues da Rocha" To: Joe Subject: Re: Between and miliseconds (timestamps) Cc: "A. Kretschmer" , pgsql-sql@postgresql.org In-Reply-To: <1163199650.682.9.camel@pampa> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_15204_559868.1163340210910" 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> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200611/119 X-Sequence-Number: 26771 ------=_Part_15204_559868.1163340210910 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 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 : > > 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 =3D > > '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=3D> select * from t2 where date(tm) =3D '2006-9-6'; > tm > ------------------------------- > 2006-09-06 00:00:01-04 > 2006-09-06 23:59:59.999999-04 > (2 rows) > > Joe > > --=20 =3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D= -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Atenciosamente (Sincerely) Ezequias Rodrigues da Rocha =3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D= -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- A pior das democracias ainda =E9 melhor do que a melhor das ditaduras The worst of democracies is still better than the better of dictatorships http://ezequiasrocha.blogspot.com/ ------=_Part_15204_559868.1163340210910 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Great Joe. That is what I want.

Now I can do a simple select (with b= etween) 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@freedomc= ircle.net >:
H= i 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 =3D
= > '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=3D> select * from t2 where date(tm) =3D '2006-9-6';
 &nbs= p;            t= m
-------------------------------
2006-09-06 00:00:01-04
2006-09= -06 23:59: 59.999999-04
(2 rows)

Joe




--
=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-= =3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D= -=3D-=3D-=3D-=3D-
         =             &nb= sp;            = Atenciosamente (Sincerely)
            = ;            Ez= equias Rodrigues da Rocha
=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-= =3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D= -=3D-=3D-=3D-=3D-=3D-=3D-
A pior das democracias ainda =E9 melhor do que= a melhor das ditaduras
The worst of democracies is still better than th= e better of dictatorships
http://ezequiasrocha.bl= ogspot.com/ ------=_Part_15204_559868.1163340210910--