Received: from ENDOR.MINE.NU (dialup-home-bartschm.psi.cl [200.29.14.67]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f0E1dNp92228 for ; Sat, 13 Jan 2001 20:39:24 -0500 (EST) (envelope-from bartschm@psi.com) Received: from psi.com (IDENT:synflood@ENDOR.PSINET.CL [127.0.0.1]) by ENDOR.MINE.NU (8.11.0/8.11.0) with ESMTP id f0E1erL12216 for ; Sat, 13 Jan 2001 22:40:55 -0300 Message-ID: <3A6103A3.135E5E8E@psi.com> Date: Sat, 13 Jan 2001 22:40:51 -0300 From: bartschm@psi.com Organization: PSINet Latin America X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.2.16-22 i686) X-Accept-Language: en, es MIME-Version: 1.0 To: Postgres SQL list Subject: Re: how to select a time frame on timestamp rows. References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200101/129 X-Sequence-Number: 790 Peter Eisentraut wrote: Thanks Peter for the answer, so i assume i can also do select user_name from tbacct where extract(month from acct_timestamp) = 11 and extract(year from acct_timestamp) = 2000 ... > > bartschm@psi.com writes: > > > today i was trying to perform a query on a database using a time stamp > > field, i need to get all records which belong to year 2000, month 11, > > is there any other way to doit, or is this the pgsql way? , actually > > i'm using a query like this: > > select User_Name from tbacct where acct_timestamp like '2000-11%' group > > by User_Name; > > select user_name from tbacct where extract(month from acct_timestamp) = 11 ... > > (SQL compliant) > > -- > Peter Eisentraut peter_e@gmx.net http://yi.org/peter-e/