BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
crawfe
Quartz | Level 8

Hi. I am new to TD coding. In DI Studio,  I would like to convert 08JAN2020 date format to mm/yyyy and

use mm/yyyy for my grouping (ie by month/year only, ignore day of the month). In SAS I used this: INPUT(PUT(date,mmyys7.),anydtdte7.

It looks too exotic but it worked good to just give me month/year.

How would I get to the same date value in teradata? Thanks!

(Is this the correct forum for TD questions?).

1 ACCEPTED SOLUTION

Accepted Solutions
crawfe
Quartz | Level 8

Thanks! I will try to get on that TD forum for my specific questions. I have always gotten helpful information here!

That worked, giving me 1Jan2020, which with the monyy7. format, displays "Jan2020". Perfect. Thanks.

View solution in original post

2 REPLIES 2
Tom
Super User Tom
Super User

It looks like you just want to move to the first day of the month.  So in SAS you would just do:

intnx('month',date,0,'b')

For Teradata questions you should ask on a Teradata forum.  But looking around quickly I found this post that seems to do what you want.

DATE - (EXTRACT(DAY FROM DATE)-1)

https://support.teradata.com/community?id=community_question&sys_id=2bba0b6f1b97fb00682ca8233a4bcba5

crawfe
Quartz | Level 8

Thanks! I will try to get on that TD forum for my specific questions. I have always gotten helpful information here!

That worked, giving me 1Jan2020, which with the monyy7. format, displays "Jan2020". Perfect. Thanks.

sas-innovate-white.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 979 views
  • 0 likes
  • 2 in conversation