From: | "Nacef LABIDI" <nacef(dot)l(at)gmail(dot)com> |
---|---|
To: | "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com> |
Cc: | pgsql-sql(at)postgresql(dot)org |
Subject: | Re: First day of month, last day of month |
Date: | 2008-04-24 16:39:06 |
Message-ID: | f16f7ea00804240939u18332952s1cf6f8f41182de30@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
It would be rather :
test=*# select date_trunc('month', current_date), date_trunc('month',
current_date)+'1month':
>
> :interval-'1sec'::interval;
"2008-04-01 00:00:00+02";"2008-04-30 23:59:59+02"
On Thu, Apr 24, 2008 at 3:15 PM, A. Kretschmer <
andreas(dot)kretschmer(at)schollglas(dot)com> wrote:
> am Thu, dem 24.04.2008, um 14:59:47 +0200 mailte Nacef LABIDI folgendes:
> > Hi all,
> >
> > I want to select data from a table according to a date column in my
> table. I
> > want to select all the rows which have date in the current month. So is
> there a
> > way to get from the actual date the first day and the last day of the
> month or
>
> test=*# select date_trunc('month', current_date), date_trunc('month',
> current_date)+'1month'::interval-'1day'::interval;
> date_trunc | ?column?
> ------------------------+------------------------
> 2008-04-01 00:00:00+02 | 2008-04-30 00:00:00+02
>
>
>
> --
> Andreas Kretschmer
> Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header)
> GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net
>
> --
> 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
>
From | Date | Subject | |
---|---|---|---|
Next Message | Emi Lu | 2008-04-25 20:33:49 | trim(both) problem? |
Previous Message | Tarlika Elisabeth Schmitz | 2008-04-24 16:12:41 | Re: extracting words |