Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id DFCB9633859 for ; Tue, 11 Aug 2009 10:13:35 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 44847-04 for ; Tue, 11 Aug 2009 13:13:32 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from kuber.nabble.com (kuber.nabble.com [216.139.236.158]) by mail.postgresql.org (Postfix) with ESMTP id DC93D6336DB for ; Tue, 11 Aug 2009 10:13:32 -0300 (ADT) Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1MarAQ-0007qL-Qa for pgsql-sql@postgresql.org; Tue, 11 Aug 2009 06:13:30 -0700 Message-ID: <24917400.post@talk.nabble.com> Date: Tue, 11 Aug 2009 06:13:30 -0700 (PDT) From: Bor To: pgsql-sql@postgresql.org Subject: Month/year between two dates MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: dborovnik@gmail.com X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.11 tagged_above=-10 required=5 tests=BAYES_05=-1.11 X-Spam-Level: X-Archive-Number: 200908/50 X-Sequence-Number: 32959 Hi to all, I have a very simple question. Let's say that I have three records (id, date from, date to): 1 2009-01-01 2009-08-31 2 2009-08-01 2009-08-10 3 2009-08-11 2009-08-31 Now I want to get records, "related" to a single month/year data (two integers). For 2009/08 (int1 = 2009, int2 = 8) I should get all three records, for 2009/05 only record 1, but for 2009/11 none of the records. Is there any simple way to do this? A query would do :). Thanks alot. -- View this message in context: http://www.nabble.com/Month-year-between-two-dates-tp24917400p24917400.html Sent from the PostgreSQL - sql mailing list archive at Nabble.com.