How to get last quarter from the particular date
How to get last quarter from the particular date
(OP)
Hello,
I need to get Last Quarter from the particular date.Please help me. This is urgent.
Regards
I need to get Last Quarter from the particular date.Please help me. This is urgent.
Regards

Talk To Other Members
RE: How to get last quarter from the particular date
Then you can add as many columns or rows representing months, quarters, etc and days in the past or future respectively.
Teradata also has a CALENDAR table - ask your DBA - but as we wanted to use our own financial calendar this wasn't too useful.
Roger...
RE: How to get last quarter from the particular date
If you don't want to use a calendar table, the easiest way to calculate the quarter is
(extract(month from aDate) + 2) / 3
If Last Quarter is the quarter before it's
(extract(month from add_months(aDate, -3)) + 2) / 3
Dieter
RE: How to get last quarter from the particular date
Thanks
RE: How to get last quarter from the particular date
Select MAX(t1.calendar_date)
From sys_calendar.calendar t1,
(select t2.quarter_of_calendar
from sys_calendar.calendar t2
where t2.calendar_date = somedate)find(qtr)
Where t1.quarter_of_calendar =
find.qtr -1