Services
24×7×365 Technical Support
Migration to PostgreSQL
High Availability Deployment
Database Audit
Remote DBA for PostgreSQL
Products
Postgres Pro Enterprise
Postgres Pro Standard
Cloud Solutions
Postgres Extensions
Resources
Blog
Documentation
Webinars
Videos
Presentations
Community
Events
Training Courses
Books
Demo Database
Mailing List Archives
About
Leadership team
Partners
Customers
In the News
Press Releases
Press Info
Services
24×7×365 Technical Support
Migration to PostgreSQL
High Availability Deployment
Database Audit
Remote DBA for PostgreSQL
Products
Postgres Pro Enterprise
Postgres Pro Standard
Cloud Solutions
Postgres Extensions
Resources
Blog
Documentation
Webinars
Videos
Presentations
Community
Events
Training Courses
Books
Demo Database
Mailing List Archives
About
Leadership team
Partners
Customers
In the News
Press Releases
Press Info
Facebook
Downloads
Home
>
mailing lists
Re: How can I get first day date of the previous month ? - Mailing list pgsql-general
From
Arup Rakshit
Subject
Re: How can I get first day date of the previous month ?
Date
June 20, 2014
10:11:26
Msg-id
1403248261.1640.YahooMailNeo@web193901.mail.sg3.yahoo.com
Whole thread
Raw
In response to
Re: How can I get first day date of the previous month ?
(Michael Paquier <michael.paquier@gmail.com>)
Responses
Re: How can I get first day date of the previous month ?
Re: How can I get first day date of the previous month ?
List
pgsql-general
Tree view
Thanks for your answer. How to get the first day date of last 6 months from now then will be :
yelloday_development=# select date_trunc('month', now()) - interval '5 month' as first_month;
first_month
---------------------------
2014-01-01 00:00:00+05:30
(1 row)
Is it correct ? I am new pgdql DB :-) Awesome DB it is...
Regards,
Arup Rakshit
On Friday, 20 June 2014 12:22 PM, Michael Paquier <michael.paquier@gmail.com> wrote:
On Fri, Jun 20, 2014 at 3:42 PM, Arup Rakshit
<
aruprakshit@rocketmail.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
--
Sent via pgsql-general mailing list (
pgsql-general@postgresql.org
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
pgsql-general
by date:
Previous
From:
Michael Paquier
Date:
20 June 2014, 09:49:40
Subject:
Re: How can I get first day date of the previous month ?
Next
From:
Dick Kniep
Date:
20 June 2014, 11:18:49
Subject:
Strange Error in postgresql 8.4
Есть вопросы? Напишите нам!
Соглашаюсь с условиями обработки персональных данных
I confirm that I have read and accepted PostgresPro’s
Privacy Policy
.
I agree to get Postgres Pro discount offers and other marketing communications.
✖
×
×
Everywhere
Documentation
Mailing list
List:
all lists
pgsql-general
pgsql-hackers
buildfarm-members
pgadmin-hackers
pgadmin-support
pgsql-admin
pgsql-advocacy
pgsql-announce
pgsql-benchmarks
pgsql-bugs
pgsql-chat
pgsql-cluster-hackers
pgsql-committers
pgsql-cygwin
pgsql-docs
pgsql-hackers-pitr
pgsql-hackers-win32
pgsql-interfaces
pgsql-jdbc
pgsql-jobs
pgsql-novice
pgsql-odbc
pgsql-patches
pgsql-performance
pgsql-php
pgsql-pkg-debian
pgsql-pkg-yum
pgsql-ports
pgsql-rrreviewers
pgsql-ru-general
pgsql-sql
pgsql-students
pgsql-testers
pgsql-translators
pgsql-www
psycopg
Period
anytime
within last day
within last week
within last month
within last 6 months
within last year
Sort by
date
reverse date
rank
Services
24×7×365 Technical Support
Migration to PostgreSQL
High Availability Deployment
Database Audit
Remote DBA for PostgreSQL
Products
Postgres Pro Enterprise
Postgres Pro Standard
Cloud Solutions
Postgres Extensions
Resources
Blog
Documentation
Webinars
Videos
Presentations
Community
Events
Training Courses
Books
Demo Database
Mailing List Archives
About
Leadership team
Partners
Customers
In the News
Press Releases
Press Info
By continuing to browse this website, you agree to the use of cookies. Go to
Privacy Policy
.
I accept cookies