I have an excel which has a date time related column. When I read the excel the values are fetched in form of a string/double value having some random numbers like 43788.8488…
I tried to use FromOAdate for for matting the whole date column as well but then it gives an exception stating “input string was not in a correct format”.
The excel formatting is of the form as shown below.
dateChangeValue = DateTime.FromOADate(CDbl(row(“Verification Date”))) , this is how I have written the code.
I am iterating the same in a for each row.
Could anyone tell what is wrong in it?
Hi
this expression is actually correct
but i think the activity is taking the date value as it is
lets check that with a writeline activity where mention like this row(“Verification Date”).ToString inside the for each row loop
lets see what value is coming in the output panel
Hi, Ashwin. The excel format for the cell/column is not helping the case and it won’t get converted to date using cdate() because the value read by the data table is some garbage value instead of the date value. Also I have kept keep formatting as checked while reading. Could that be an issue?
I found out the issue why the code mentioned by you and myself wasn’t working. It was because there was a row which had a blank value for the date due to which it was giving an error “invalid string” . Just needed to delete that row and it worked.