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

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.


  • John Curtiss (i hate the web admin)

    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.

  • Nick Brinsko (Customer)

    ​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.