Hi, as stated in the subject line I need to convert multiple V-WString fields to Date fields and I want them to come out in Mon.-yy format. The V_WString is currently in Mon.-yy format, but of course it is text vs. an actual date. I appreciate the help in advance!
Solved! Go to Solution.
I am not understanding your ask. Your incoming data is Mon.-yy and you want the output to Mon.-yy. Mon.-yy is not a date type format so to my knowledge you cannot force it to be date. Date = Nov.-24?
Agreed with @MelGibson - either it's going to be a Date format as YYYY-MM-DD or it's going to be a string data type if it's in any other format
Thank you both for responding! Ok, I gotcha. So just to confirm, for Alteryx to recognize the string as a date data type, it can absolutely only be YYYY-MM-DD?
I want the output to be Date = Nov. 24 or Nov-24, any variation of month/year would work.
That’s correct. And I think we are both confused, what is the original value’s format? if it is in a date format, you would use the function datetimeformat to take that value and use specifiers to get it the way you want: https://help.alteryx.com/20232/en/designer/functions/datetime-functions.html
Ok thanks. What is the best way to utilize the multi-field formula tool to convert the V_WStrings to Date format?
If you cannot have a date type with the format you requested above - what date type would be acceptable?
@peyton-brooks I think we are still both confused about what you are trying to accomplish now. Please provide your current starting data (even a sample) and your expected output.
@peyton-brooks if you want to convert multiple fields from Mon.-yy into actual dates, then you can use this formula:
datetimeparse([_currentfield_],'%b.-%y')
Like this:
(I've ticked the 'Copy output fields and add' option to demonstrate the change here)
Make sure to change the output type to date.
Hope that helps,
Ollie
@peyton-brooks If at the end of your workflow you want to convert these back to the original format as a string, then
datetimeformat([_currentfield_],'%b.-%y')
will reverse the change