Re: Month/year between two dates

From: "ramasubramanian" <ramasubramanian(dot)g(at)renaissance-it(dot)com>
To: "Bor" <dborovnik(at)gmail(dot)com>, <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Month/year between two dates
Date: 2009-08-12 03:59:38
Message-ID: 207AA50147184F3885AB00BE4BA6CE0A@ramasubramanian
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Dear Bor,
How you will 1 record for 2009/05 (if you use 2009/05 ) it will fetch
all the records as it is not having month 05
am i correct?

----- Original Message -----
From: "Bor" <dborovnik(at)gmail(dot)com>
To: <pgsql-sql(at)postgresql(dot)org>
Sent: Tuesday, August 11, 2009 6:43 PM
Subject: [SQL] Month/year between two dates

>
> 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.
>
>
> --
> Sent via pgsql-sql mailing list (pgsql-sql(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-sql

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message ramasubramanian 2009-08-12 04:01:13 Re: mail alert
Previous Message Rob Sargent 2009-08-12 01:38:26 Re: mail alert