Alert: There is a planned Community maintenance outage October 16th from approximately 10 - 11 PM PST. During this time the Alteryx Community will be inaccessible. Thank you for your understanding!

Alteryx Designer Desktop Discussions

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

Converting Date to String

I need to convert a date to a string and then back to a date as I am experiencing the problem outlined in this article.  How do you go about converting a Date to String?

 

https://stackoverflow.com/questions/50476941/error-while-writing-data-from-python-to-redshift-invali...

8 REPLIES 8
Hakimipous
10 - Fireball

Hi !

 

Did you take a look at the DateTime Tool in the Parse section ?

danilang
19 - Altair
19 - Altair

Hi

 

To change a date to a string, use the DateTimeFormat(dt,f) function in a formula tool (Find examples of the function under the DateTime section on this page).  The syntax for the format string, the f parameter, is unique to Alteryx so check out DateTimeFunctions.htm for samples

 

 

Dan

Hi Dan, 

 

I am trying to convert a Date Field (coming from Salesforce) into a String or Number as when I attempt to move the date field to Amazon RedShift it gives me an error because there are blank values (not all rows have certain dates completed).   With that said, I have read that I can turn the date field into a string or number and then work with it outside of Alteryx (within Tableau) that way. 

 

Everything I see is about turning a string into a date, not the other way. 

 

Thanks in advance for any further assistance you can provide. 


David

Hakimipous
10 - Fireball

@cockrumconsulting 

 

The DateTime tool allows you to convert a Date field to a string, or even the Select tool allows you to do so.

 

Isn't taht what you are looking for? 

datetime.PNG

 

 

That does help… I now get Delimiter not found error.

[cid:image001.png@01D4541F.2B078720]
Hakimipous
10 - Fireball

@cockrumconsulting 

 

Could you post a screenshot? 

 

And meanwhile try to change to format with the Select tool, it's the simpliest way.

 

I could help further if you provide a sample of data

Figured it out… Turns out I needed to uncheck this field on Output Data (to Redshift).

[cid:image001.png@01D45426.BF834A90]
Hakimipous
10 - Fireball

@cockrumconsulting

 

Great to hear :D 

 

Could you please mark this as solved ? 

Labels