I want to convert V String to Date, and turn to the last day of each month. Such as convert Jun-20 to 6/30/2020. How to do that?
Current (Date Type: V_String) | Change to (Data Type: Date) |
Jun-20 | 6/30/2020 |
Jul-20 | 7/31/2020 |
Aug-20 | 8/31/2020 |
Sep-20 | 9/30/2020 |
Oct-20 | 10/31/2020 |
Nov-20 | 11/30/2020 |
Solved! Go to Solution.
Let's start with fixing the date to the first, then adding a month and finally subtracting a day.
datetimeadd(
Datetimeadd(
DateTimeParse(
left([current data],4) + "01-"+
Right([current data],2), "%b-%m-%y")
1,"Months")
-1,"days")
cheers,
mark
Thanks for replying.
I pasted your formula to my workflow, but run into “Malformed Function Call”.
Now with the change of one joining data source, I need to convert the V_String to YYYY-MM-DD format. Will that be easier?
Current (Date Type: V_String) | Change to (Data Type: Date) |
Jun-20 | 2020-06-30 |
Jul-20 | 2020-07-31 |
Aug-20 | 2020-08-31 |
Sep-20 | 2020-09-30 |
Oct-20 | 2020-10-31 |
Nov-20 | 2020-11-30 |
Hi @LEXQ2005 ,
you could try:
DateTimeAdd(DateTimeAdd(DateTimeParse([Current], '%b-%y'), 1, 'month'), -1, 'day')
DateTimeParse([Current], '%b-%y') converts month-year to the first day of the month in date format, adding one month and subtracting one day results in the last day of the month.
Let me know if it works for you.
Best,
Roland