Sunday, 1 September 2013

get last month last and first date

To get last month's last and first date


SELECT (date_trunc('month', now()-interval '6 month')::date - 1) as last_month_date

SELECT (date_trunc('month', now()-interval '6 month')::date ) as first_month_date 

The above query can be used to get last month's last date from current month

No comments:

Post a Comment