Hi, I have an excel sheet where Robot Start Date column is in General format. Its supposed to contains values in datetime format MM/dd/yyyy HH:mm:ss
I would like to filter the datatable to create a second datatable for rows which have the same date MM/dd/yyyy
I’ve tried Dt.Select(“[Robot Start Date] LIKE ‘%MM/dd/yyyy%’”).copytodatatable
and it says cannot perform operand LIKE on system.string and system.datetime
I cannot use filter datatable activity because it is not a table in the Excel sheet.
You can use the excel filter (in excel application) to get this done. Then read the resulting sheet as a dataTable if needed.
Check this out. Kind of a similar scenario. Have mentioned shortcuts for working with filters.
I also tried converting the datetime column into string and then check if the column’s strings contains my datetime in short date format, works too.
datatable = (From p In Datatable.Select() Where Convert.ToString((p.Item(“Datetime Column Name”))).Contains(DateTime.toshortdatestring) Select p).ToArray.CopyToDataTable