Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Month Only From Date

david_rogers
7 - Meteor
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.
10 REPLIES 10
Ned
Alteryx Alumni (Retired)
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.
david_rogers
7 - Meteor
Excellent...thanks.
alex
11 - Bolide

How about if you want to end up with February?

danielbrun2
ACE Emeritus
ACE Emeritus

Hi,

 

Then it is:

 

DateTimeFormat([Field1],"%B")

 

Best regards,

Daniel

alex
11 - Bolide

I totally missed that in the help section.  So used to MMMM in excel.  Thanks.Smiley Happy

s_pichaipillai
12 - Quasar

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!!!

GururajSetty
5 - Atom

the datetimeformat function is not working 

it is telling orderdate is not a valid datetime

 

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

ParvathyK
5 - Atom

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

eprince1410
5 - Atom

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