
Ron Grempler (Customer) asked a question.
Using this would decrease the month by one
"[dd][mm-][yyyy]" "26052020"
What would be needed to decrease the month by two
"[dd][mm-][yyyy]" "26052020"
What would be needed to decrease the month by two
Need add an If statement that searched for a filename with the month and year in the filename but only want the files that are two months from the current month.
Modifying date values beyond 1 is not easy with macros. The best way to do this is with a custom script. Here is a similar script that was intended for renaming files but you should be able to modify it slightly to be able to use the -2 month value in your IF.
https://community.progress.com/s/question/0D54Q00007oKe11SAC/moveit-automation-modifydateps1
so in the old ipswitch community, there was a thread about this. i wouldn't know how to go about finding that post now. but i did find a test task in my environment that i think was born from that. try this
[dd][LEFT([MM-][MM-],2)][yyyy]
i don't know why it works, but it does seem to work. and it still also decrements the YYYY macro if you skip from january back to november.
also if you are doing this daily, you might be able to use a filter to only get files whose modified dates are older than 59 or 60 days, instead of trying to get the individual dates.
That is a very interesting solution! It works because using multiple [MM-] macros causes them to stack. This is taking the left 2 characters from "MM-2 MM-2". Another way to take advantage of the "-" stacking is to put [dd][MM-][yyyy];[MM-] in the source. This will look for "DDMM-2YYYY" OR "MM-2" however presumably the second filename does not exist.