Overload resolution failed because no accessible 'Select'

Hello Everyone,
I’ve some issue for LINQ method to convert date time format

Example:

dt1
Date
5/17/1986 00:00:00
7/05/1994 00:00:00
12/10/1973 00:00:00

Expected:
05/17/1986 00:00:00
07/05/1994 00:00:00
12/10/1973 00:00:00

Issue:

Anyone can help?

Regards,
Brian

At least this one ist to correct
grafik

the single digit 5 will need the parse format d/
but a 5/17/1986 is of format M/dd/yyyy

Hi @Brian_Henokh1

Can you try the following sample?

(From row In DT.AsEnumerable()
       Let originalDate = DateTime.ParseExact(row.Field(Of String)("Dates"), "M/d/yyyy HH:mm:ss", System.Globalization.CultureInfo.CurrentCulture)
       Select DT.Clone().Rows.Add(originalDate.ToString("MM/dd/yyyy HH:mm:ss"))
      ).CopyToDataTable()

I/P:
image

O/P:
image

Hope this helps!!

we recommend to first analyze what is within the data table for values placed
:ambulance: :sos: [FirstAid] Datatable: Debug & Analysis invalid DateTime Strings / String to DateTime Parsing Issues - News / Tutorials - UiPath Community Forum