Hello everyone. I have a column in excel that I transform into a Data Table.
My dates are in formats : dd/MM/yyyy
Others (in green) are in MM/dd/yyyy format
I would like to convert these dates (in green) to dd/MM/yyyy format. Here is my flow:
Here is the error I get
Can you help me? Please ?
ppr
(Peter Preuss)
March 20, 2023, 1:58pm
2
1 Like
Yoichi
(Yoichi)
March 20, 2023, 2:10pm
3
Hi,
Data in green cell seems datetime type in excel. If so, the following ForEachExcelRow might help you.
Condition
CurrentRow("date_article").RawValueType =Type.GetType("System.DateTime")
Then
CurrentRow("date_article") = CDate(CurrentRow("date_article").ToString).ToString("dd/MM/yyyy")
Regards,
Hello, thank you for your answer. I tried this however I can’t make my condition, I have this error:
Compiler errors encountered while processing expression CurrentRow(“date_article”).RawValueType =Type.GetType(“System.DateTime”).(2) error BC30574 Option Strict On reject all late bindings
Hello @DimitriLYR
try below. I have modified the @Yoichi code a little bit
CurrentRow("date_article").GetType = Type.GetType("System.DateTime")
1 Like
Anil_G
(Anil Gorthi)
March 20, 2023, 4:41pm
6
@DimitriLYR
The code given above works inside a use excel scope…i guess you are trying to do it inside a for each row in datatable…please check
Cheers
1 Like
I actually use a data table.
Anil_G
(Anil Gorthi)
March 21, 2023, 8:57am
8
@DimitriLYR
Then i would suggest use as below
use a try catch around the asign activity where you are converting the date…
In the catch block use another assign but now use DateTime.ParseExact(datestring,"dd/MM/yyyy",System.Globalization.CultureInfo.InvariantCulture).ToString("dd/MM/yyyy")
cheers
system
(system)
Closed
March 24, 2023, 8:57am
9
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.