Hello. I have a need to get the first date of the prior month and display it in plain English. In my formula tool I have:
todate(datetimeadd(DateTimeFirstOfMonth(),-1,'month'))
which converts it to Alteryx syntax fine.
Then with the DateTime tool I'm able to convert to a string using the "Month dd, yyyy" format. Which works great but I'd like to just do it all within one formula tool. What is the syntax for that? Is there a Regex/Date formula to convert that all in one? The column with the red arrow is what I need.
Solved! Go to Solution.
@Adam_Dooley Try this in a formula tool:
DateTimeFormat(datetimeadd(DateTimeFirstOfMonth(),-1,'month'),"%B %d, %Y")
Edit: The datetime specifiers are here in the help docs.
@Adam_Dooley You can use the datetimeformat() function to get this done.I nested this formula in front of the formula you provided.
datetimeformat(ToDate(DateTimeAdd([Date],-1,"month")),'%B %d, %Y')
%B - month (September)
%d - day (01)
%Y - year (2019)
Attached is the workflow. Does that help?
Boo ya thank you both!