Re: How can I get first day date of the previous month ?

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Arup Rakshit <aruprakshit(at)rocketmail(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: How can I get first day date of the previous month ?
Date: 2014-06-20 06:49:34
Message-ID: CAB7nPqR5kh3zPajY5_D=BR_awDOYVxmsJVP2qrg0uKkS8E-1TA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Jun 20, 2014 at 3:42 PM, Arup Rakshit
<aruprakshit(at)rocketmail(dot)com> wrote:
> How can I get first day date of the previous month. Last day of previous
> month can be found using the answer -
> http://stackoverflow.com/a/8945281/2767755
Here is how to get the first day date of the previous month:
=# select date_trunc('month', now()) - interval '1 month' as last_month;
last_month
------------------------
2014-05-01 00:00:00+09
(1 row)
--
Michael

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Arup Rakshit 2014-06-20 07:11:01 Re: How can I get first day date of the previous month ?
Previous Message Arup Rakshit 2014-06-20 06:42:55 How can I get first day date of the previous month ?