I have to get data for an incured date which should have current month, previous month and same month(current month) previous year?
I need to get data for these three months for comparison.
Example : 2017-12-01, 2017-11-01 and 2016-12-01
Any idea or help will be really appreciated.
Thank you
A combination of ADD_MONTHS plus TRUNC/LAST_DAY...
Sorry! could you please elaborate? Thank you.
See the SQL Functions manual at info.teradata.com for your release of Teradata.
select trunc(date'2017-12-22','RM') (format'y4-mm-dd')
,add_months(trunc(date'2017-12-22','RM'),-1)
,add_months(trunc(date'2017-12-22','RM'),-12);