community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
SOLVED

Month Only From Date

I have a DateTime field.  The current format is 2015-02-02 00:00:00.  I simply want to pull from this date the month in a string format.  The answer should be 2.  I'm sure it's easy, I've looked but not able to find an answer.
Founder
Founder
Use a formula tool.  You could either do:

   DateTimeFormat([Field1],"%m")

or

   Substring([Field1],5,2)

Either way works the same.  It all depends if you want to think of it as a date or as a string.
Excellent...thanks.
Bolide

How about if you want to end up with February?

Alteryx Certified Partner
Alteryx Certified Partner

Hi,

 

Then it is:

 

DateTimeFormat([Field1],"%B")

 

Best regards,

Daniel

Bolide

I totally missed that in the help section.  So used to MMMM in excel.  Thanks.:smileyhappy:

here is the full datetime functions reference to play with :)

http://help.alteryx.com/9.5/Reference/DateTimeFunctions.htm 

Have fun and Happy Data Blending!!!

the datetimeformat function is not working 

it is telling orderdate is not a valid datetime

 

pls help me to solve this......

Hi,

 

This works with the regular formula tool, but not In-database. Could you tell me how to extract month with the In-database formula tool?

 

Thanks,

Parvathy

Highlighted

What if you're trying to get the month# as int36 so that you can then multiply it with another #? I am trying to populate last month's # to then multiply it with a quota to get YTD quota. Every time I get an error because it is vstring.

Labels