Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jun 20, 2014 at 3:42 PM, Arup Rakshit
<aruprakshit@xxxxxxxxxxxxxx> 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



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux