DateTime conversion issue
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi All,
I have a DateTime fields which is coming from DB in format "2020-12-20" (ie. "YYYY-MM-DD" ), which i wanted to reformat to "MM/DD/YYYY" and write to another DateTime fields in SQL Database.
Please help.
Thanks,
Preethi
- Labels:
- Date Time
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
What is the purpose of having your values in "MM/DD/YYYY" format? Is it just for presentation, or are you trying to filter/sort/calculate off of this field?
The correct format for a date in SQL is YYYY-MM-DD, which is why your data is coming into Alteryx in that format as well. Any other format (in Alteryx or SQL) would be considered a string, not a date. You can easily convert the format using the Datetime tool in Alteryx, but the result would be a string. If this is just for presentation purposes, that should work, and the output would need to go to a string field in the SQL database.
