Received: from localhost (unknown [200.46.204.184]) by developer.postgresql.org (Postfix) with ESMTP id 984B02E003D for ; Thu, 24 Apr 2008 10:06:37 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 33161-10 for ; Thu, 24 Apr 2008 10:06:20 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from tomts16-srv.bellnexxia.net (tomts16.bellnexxia.net [209.226.175.4]) by developer.postgresql.org (Postfix) with ESMTP id 0F1BA2E0037 for ; Thu, 24 Apr 2008 10:06:27 -0300 (ADT) Received: from toip6.srvr.bell.ca ([209.226.175.125]) by tomts16-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20080424130626.RRYT1723.tomts16-srv.bellnexxia.net@toip6.srvr.bell.ca> for ; Thu, 24 Apr 2008 09:06:26 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArEEADoiEEhBX6ix/2dsb2JhbACBUqtl Received: from bas3-london14-1096788145.dsl.bell.ca (HELO t60p.bax.ca) ([65.95.168.177]) by toip6.srvr.bell.ca with ESMTP; 24 Apr 2008 09:03:10 -0400 Message-ID: <481085D1.2010807@sympatico.ca> Date: Thu, 24 Apr 2008 09:06:25 -0400 From: Frank Bax User-Agent: Thunderbird 2.0.0.6 (X11/20070818) MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Re: First day of month, last day of month References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200804/150 X-Sequence-Number: 30689 Nacef LABIDI wrote: > is there a better method to retrieve all > the rows with dates in the current month. select * from mytable where extract(month from mydate) = extract(month from now()) and extract(year from mydate) = extract(year from now());