how to convert a period of D+30, D+60 etc to exact day and month
Teradata Teradata Discussion Forums Teradata.com Discussion Forum
Visit Teradata.com
Home       Guidelines    Member List
Welcome Guest ( Login | Register )
        


This online forum is for user-to-user discussions of Teradata products, and is not an official customer support channel for Teradata. If you require direct assistance, please contact Teradata support.


how to convert a period of D+30, D+60 etc to... Expand / Collapse
Author
Message
Posted 2/27/2006 4:49:49 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 3/1/2006 4:45:00 AM
Posts: 1, Visits: 1
To avoid hard codding the months in the ADS we have been Creating 4 ADSs with historical customers data for Churn with period of 30 days instead of calendar month: Day-30, D-60, D-90, and creating the detection period with D+30, D+60, D+90. We are also creating a table called Customer DNA where we load the customers data from the ADSs with the scores. Now, the customer wants to do some reporting but with calendar month so rather than recreating the ADSs with calendar month I have been told that 'SysCalendar' could map the periods to the exact day of the month and allow the customer to manage the performance of the his company based on months not period of 30 days. Any hint that make the transition easy between periods and calendar month without changing the ADS?
thanks.
J.
Post #3604
Posted 2/27/2006 3:30:53 PM


Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 9/23/2006 9:38:00 PM
Posts: 21, Visits: 1
Try the sql extract month from date feature...


hh - hope it helps
teradata.com
Post #3606
Posted 3/1/2006 9:42:49 AM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: 6/9/2008 2:55:55 PM
Posts: 185, Visits: 2
You can do quite a bit with the dates without using SysCalendar. For instance, to add or subtract months, you can use the ADD_MONTHS feature:

SELECT ADD_MONTHS(date_col, 2) /* this will add two months */

SELECT ADD_MONTHS(date_col, -2) /* this will subtract two months */

You can extract the year, month, or day out of the date as well with the EXTRACT function (ex. EXTRACT(MONTH FROM date_col)). I would only advise you to use SysCalendar if you need to set up some custom calendar (i.e. your "fiscal" or "calendar" dates do not align with the normal calendar) or you find that you can't do what you want using the date functions.

Hope this helps.

Barry
Post #3637
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 2 ( 2 guests, 0 members, 0 anonymous members )
No members currently viewing this topic.


All times are GMT -5:00, Time now is 10:28pm

Powered By InstantForum.NET v4.1.4 © 2008
Execution: 0.156. 10 queries. Compression Disabled.