I have a datatable with daterows in the format: 2018-04-01-2018-4-30
I would like to change these daterows to the format: 010418-300418
For me this a difficult one to start with, I work with a ForEach in a datatable activity. Should I use a Regex expression? Does anyone know how this should look like then? What would be the best solution?
Thank you for your reply, I will give you a small summary of my first topic.
I have a datatable with daterows in the format: 2018-04-01-2018-4-30
I would like to change these daterows to the format: 010418-300418
For me this a difficult one to start with, I work with a ForEach in a datatable activity. Should I use a Regex expression? What would be the best solution?
The best solution is to save the dates in a DateTime (eg. firstDateVariable & secondDateVariable) variable. Then to output your date in a wanted format simply type firstDateVariable.ToString(“ddMMyy”). dd gives the date in two characters, MM is the month (mm is used for minutes) and yy is the two most righthand characters of the year. (yyyy would result in a 2018 output)
For me this is still a difficult one. I tried regex, substring, changed variables, and read a lot on this forum, I still have errors. I attached my workflow to this topic.
Now I get the date from a get row activity from a datatable, I think I need to use the generic variable because now the flow doesn’t work anymore. How can I change it to genvariable.ToString?
Additional info: Just changing to GenericValue in the variables pane doesn’t work for me.
I applied your solution to my Excel with several rows in this old date format. I would like to only use it when the first column is equal to 1. In the output line the answers look perfect!
Now I want to replace the new values over the old values by using add data row in the same Excel. However, I still have errors by using add data row.
Do you have an idea how to replace the new values over the old values? I attached my workflow + Excel in this topic.