Take month and year

2

I have a variable containing it an expression that corresponds to a directory of folders.

I want to show the year and the previous month:

"c: \" + SUBSTRING ((dt_str, 50, 1252) GETDATE (), 1, 4) + "\" + RIGHT ("0" + (DT_STR, 2, 1252) MONTH ", -1, GETDATE ())), 2)

Sai: c: \ 2017 \ 09

, but let's imagine that we are in the month January and the previous month is (12) and the year is also the previous one. As it is, every year I would be forced to intervene.

Is there no way around this and put a relationship between the month and the year so that it is always automatically?

    
asked by anonymous 04.10.2017 / 17:04

1 answer

0

You get a case, the case in the SSIS expressions looks like this: link

    
19.10.2018 / 11:50