Could you help me to convert this datetime field to number?
The input file is like the input file attached and the tool gave me a datetime field as the input tool attached.
Solved! Go to Solution.
For an Excel input, try using the File Format Microsoft Excel Legacy
For the File Format drop-down, my understanding is:
Microsoft Excel is a driver created and maintained by Alteryx
Microsoft Excel Legacy is a driver created and maintained by Microsoft
Sometimes the two drivers produce different results
If that doesn't work, use the option First Row Contains Data
Then you'll get each field as a String and will need to change data types as needed. And use the Dynamic Rename tool to get the correct field names.
Chris
Can you please attach some sample input file?
Your easiest way to fix this is to turn the column into numbers in excel. right now the column is a date in excel (I know - it looks like a number). so alteryx is interpreting it as a date (and the result is a messy time add to 1899-12-31.)
Unfortunately we are not allowed to edit the input but thank you for your answer anyway!
It looks like you want to convert a datetime field to a number in Alteryx.
You can follow these steps:
Drag and Drop Input Tool:
Select the Datetime Field:
DateTime to String:
Formula Tool:
Output Tool:
Here's an example formula you might use in the Formula tool:
ToNumber(DateTimeToString([YourDateTimeField], "%Y%m%d%H%M%S"))
Replace [YourDateTimeField] with the actual name of your datetime field.
This formula converts the datetime field to a string in the format "YYYYMMDDHHMMSS" and then uses ToNumber() to convert it to a numeric value.