Alteryx Designer Desktop Discussions

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

Convert date time format to date

troy_mech
8 - Asteroid

 I have column with data type date format 2020-01-30 15:02:45, i need to convert this into 30/01/2020. 

9 REPLIES 9
grazitti_sapna
17 - Castor

Hi @troy_mech , try this.

 

Formula- DateTimeFormat([Field1],"%d/%m/%Y")

 

grazitti_sapna_0-1598423437864.png

Thanks.

 

Sapna Gupta
troy_mech
8 - Asteroid

Thank you for your response. This is not working since my data type is DateTime but the screenshot you shared has the data type V_Wstring. Is there any other way to convert this format, please assist.

 

Venkatesh_Sampath_0-1598429064337.png

 

grazitti_sapna
17 - Castor

@troy_mech , that will not be possible as the default date/time format in alteryx is yyyy-mm-dd and we are converting it to a custom format dd/mm/yyyy so that has to be in string format in order to reflect the result.

Thanks.

Sapna Gupta
paulfound
11 - Bolide

Hi @troy_mech 

 

I would use a Multi-Field tool,

PaulFound_1-1598444334784.png

This will allow you to change the type.

 

PaulFound_0-1598444315657.png

PaulFound_2-1598444383474.png

 

Likness
6 - Meteoroid

The Muti-Field Formula works well. The only difference from the visual above is Changing the Output Type to Date to solve original question.

atcodedog05
22 - Nova
22 - Nova

Hi @Likness ,

 

%d/%m/%Y is not a alteryx accepted date fromat.

DataMeister
7 - Meteor

Paul: This is like a formula posted by Joe Mako elsewhere, which takes the DateTime and just converts it into a String that doesn't show the time--that's not a change in datatype from DateTime to Date. The problem is that Alteryx developers are not listening to users; we need one tool where we can specify basic date handling functions--it's not rocket science, just lack of focus.

Another pet peeve is that folks are saying "format" when they mean "datatype" and vice versa.

Sereshan
5 - Atom

You can use a select tool to remove the time, by just changing the data type from DateTime to Date only

KenAtHubbell
6 - Meteoroid

You can manage the data type conversion in a formula by creating a new field that is a date and setting it equal to the field having the datetime value.  Same as using a SELECT tool but cleaner; especially since you can stack the formulas into the same tool.

Labels