How to get yesterday's month name using a Data variable? - VisualCron - Forum

Community forum

viper8
2011-02-23T15:34:11Z
Hello all,

I have a challenge for you. I have an email task that needs the Subject to be the name of yesterday's month. I see how to get the current month using {DATE(Month.Name)}, and also how to get yesterday's date using {DATENOWADD(Days|-1|M/d/yyyy h:mm tt)}, but how do I get yesterday's month name? Any tricks would be helpful! 😁

Thanks!
ErikC
2011-02-23T19:53:55Z
Hi viper8,

I think you can do this with the formula {DATENOWADD(Days|-1|M/d/yyyy h:mm tt)}, but you have to change the dateformat into MMMM:

{DATENOWADD(Days|-1|MMMM)}

documentation:
M, MM, MMM, MMMM
Month. MM = 2 digit, MMM = abbreviation (ie, "Jan"), MMMM=spelled out

This should do the trick I think.

Regards,
Erik
Uses Visualcron since 2006.
viper8
2011-02-23T20:18:38Z
That worked!! Thank you very much Erik!
ErikC
2011-02-25T08:43:17Z
ErikC wrote:

{DATENOWADD(Days|-1|MMMM)}



You need use the Months option here, not the Days. I overlooked...

For the name of the last month:

{DATENOWADD(Months|-1|MMMM)}

Regards
Erik
Uses Visualcron since 2006.
Scroll to Top