Subtract one month from date

I would use a Java Snippet as it is the easiest implementation.

// system imports

import java.util.GregorianCalendar;

// system variables

// Your custom variables:

// expression start

Calendar calendar = new GregorianCalendar();
calendar.add(Calendar.MONTH, -1);
calendar.set(Calendar.DAY_OF_MONTH, 1);

out_newDateTime = calendar.getTime(); // this generates a dateTime variable
out_newStrFlowVar = out_newDateTime.toString(); //this generates a Date string

where the out_newDateTime variable is defined as a DateandTime object for a column and

where the out_newStrFlowVar variable is defined as a string for a flow variable (using the default string format).

 

I was not sure what format you needed it so I included both.

If you need the string in a different format you can use a SimpleDateFormat object.

Hope this helps,

-- Scott