ppr
(Peter Preuss)
October 14, 2020, 1:12pm
21
@Sahil_Garg
debug this excel and share the screenshot of the resulting datatable with us.
The values that we see in Excel are not mandatory the same as we do get in the datatable. So we have to check if it is present in another format e.g. MM/dd/yyyy HH:mm:ss
give a try
Sahil_Garg
(Sahil Garg)
October 14, 2020, 1:34pm
22
Please see value is coming in dd/MM/yyyy hh:mm:ss, given the value in array
But after that
This is the array :{“dd-MMM-yyyy”,“dd-MM-yyyy”,“dd/MM/yyyy”,“dd/MM/yy”,“MM/dd/yyyy”,“MMM/dd/yyyy”,“M/d/yy”,“d/MM/yy”}
I have seen same for others also hh:mm:ss is coming in them but they are working fine
ppr
(Peter Preuss)
October 14, 2020, 1:46pm
23
it looks like you are iterating within a for each row, so you can inspect the failing row / column value while debugging.
As the message box shows the different date format so it should be added to the formats list
with the given XAML (checking non valid date formats) you have an option / tool to analyse and to collect the missing formats
Sahil_Garg
(Sahil Garg)
October 14, 2020, 2:03pm
24
In debug also same value is coming
Actually i am getting datatable from different source , only this one is creating problem.
If am using simple CDate(Date) working fine , but creating issue for other,
your way is good but not working on this one only.
I just want to get months from this dates and add new column with values of Months
ppr
(Peter Preuss)
October 14, 2020, 2:05pm
25
did you add it to the format array? MM/dd/yyyy HH:mm:ss
Sahil_Garg
(Sahil Garg)
October 14, 2020, 2:12pm
26
Hi ,
You are awesome, it is working for this one also.
It means we should also care about HH:mm:ss.
Thanks , you really a next level
system
(system)
Closed
October 17, 2020, 2:12pm
27
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.