Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Don't forget to submit your entry for the Excellence Awards by October 30! | Need more information about the program? Check out the blog here
SOLVED

Convert Date to String without using the DateTime tool

Highlighted
8 - Asteroid

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. 

 

Capture.PNG

 

Highlighted
16 - Nebula
16 - Nebula

@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.

 

Highlighted
Alteryx
Alteryx

@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)

alteryx_logo.png

Attached is the workflow. Does that help?

Digan
Alteryx
Highlighted
8 - Asteroid

Boo ya thank you both!  

Labels