![]() |
|
Archives of the TeradataForumMessage Posted: Thu, 02 Nov 2006 @ 09:46:51 GMT
I think the best way is to use system calender table.
SELECT
c1.month_of_calendar - c2.month_of_calendar
FROM
sys_calendar.calendar c1 , sys_calendar.calendar c2
WHERE
c1.calendar_date = current_dt and c2.calendar_date = previous_dt
current_dt & previous_dt can be any date . Just test it !! Best Regards, Manpreet
| ||||||||||||||||||||||||||||||||||||||||||||||||
| | ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||
| Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
| Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||