Skip to main content
Nintex Community Menu Bar

How to get previous month or next month based on current date in Nintex workflows? Please help

  • November 15, 2017
  • 3 replies
  • 197 views

Forum|alt.badge.img+1

I have a field where we store month like January, February.. December.. I have a requirement to fetch last month records. I am trying to get previous month based on current date. But unable. To figure out how to do that. Is there an easy function where I can add / subtract and get desired month based on current date? 

3 replies

Forum|alt.badge.img+12
  • Nintex Partner
  • November 16, 2017

Did you have a look into the calculate date action? You can use the current date as base and then enter -1 into the month field. This will subtract one month from the date and return it as a date variable that you can use.

you can also do this with positive values which will add a month.

I understood that you have saved the date in your list with full month names, like January, February and so on.

You can add a set variable action after you calculated the date and set a text variable (Like month name) with the following inline function

fn-FormatDate(yourcalculateddate, “MMMM“)

This will convert your date to a text containing only the name of the month name of that date.

Hope this helps a bit.

Best regards,

Enrico


Forum|alt.badge.img+1
  • Author
  • November 16, 2017

Oh, I see what you are saying. So I use calculate date action and set month as - 1 based on action execution date, get the date, and use formatdate function to convert date in actual month string. Trying it out now. Thank you so much for guidance happy.png 


Forum|alt.badge.img+1
  • Author
  • November 17, 2017

That did the trick. Thank you happy.png