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?).
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.
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
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.
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.
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.
Ready to level-up your skills? Choose your own adventure.