pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bor <dborovnik@gmail.com>
To: pgsql-sql@postgresql.org
Subject: Month/year between two dates
Date: Tue, 11 Aug 2009 06:13:30 -0700 (PDT)
Message-ID: <24917400.post@talk.nabble.com> (raw)


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.




view thread (4+ messages)  latest in thread

Message-ID: <24917400.post@talk.nabble.com>
Permalink:  ../24917400.post@talk.nabble.com/
Also on:    postgresql.org/message-id/24917400.post@talk.nabble.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: dborovnik@gmail.com
  Subject: Re: Month/year between two dates
  In-Reply-To: <24917400.post@talk.nabble.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox