@NewUsrStat wrote:
Hi guys, I have a date like this: 01JUL2021. How can I get 01JUL2020? I need to subtract exactly one year.
I tried the following but without success. The date is no more "01JUL"
my_new_date = INTNX('YEAR',mydate,-1);
So just to be 100% complete, when a date is 01JUL2021 in a numeric variable, then @FreelanceReinh has the solution. But if the date of 01JUL2021 is in a character variable (is it? you don't tell us) then that won't work. Then you want this:
one_year_ago = intnx('year',input(char_date_variable_name,date9.),-1,'s');
... View more