Is there a way to remove the hours, minutes and seconds from this formula? Also is there a way to arrange it so that it appears in the MM:DD:YYYY format?
Please see the attached picture for reference. Thanks.
Solved! Go to Solution.
Hi @sabidor829
You can use ToDate() to remove the hours.
If you want to parse to MM:DD:YYYY format, you can use the DateTimeFormat function
DateTimeFormat([Date], "%m:%d%Y")
Cheers,
If you change the Data type to Date format the output will be only the date, if you change it to DateTime the output will be DateTime format, since you using Data type as V_String then the output will include the time as well.
To re-format the DateTime you can use the DateTime tool or better you can use the DateTimeFormat() function in the formula tool like the attached pic.
Please check the DateTime functions to learn about all the available specifiers.
Cheers
AliAS
So I was able to remove the hours but i can't change the format for some reason.
Currently it appears as YYYY-DD-MM and I want MM-DD-YYYY.
When I run the workflow, i get that MM-DD-YYYY is not a valid date.
Any reason as to why you think i get that error?
I used a select tool to convert it to a date and now I am setting the formula up.
If you format the Date to your desired format, it stops being a Date Type and it needs to become a string type. So you need to convert to "String".
The only Date format allowed to a Date type in Alteryx is YYYY-MM-DD.
That being said, follow the instructions I already sent on the 2nd post:
- Use the ToDate([Field]) expression to get rid of the HH:MM:SS
- Convert your field to String
- Use the DateTimeFormat expression.
Cheers,
Thank you
User | Count |
---|---|
19 | |
15 | |
15 | |
9 | |
8 |