Filter Data Table DayOfWeek

I have a table in excel that I download as an email attachment with the following data.

The data in column “B” are for a period of one week. How can I filter day by day? I tried through dayofweek as 06.03.2023 is Monday but the robot says it’s not Monday I guess because of the time

@pl.rusinov Can you explain your problem in details. btw you can split the time and date using split.
DateValue = currentrow(1).split(" "c)(0) - this will give you the only date as string then parse it using
DayName = date.ParseExact(DateValue,“dd.MM.yyyy”,system.Globalization.CultureInfo.InvariantCulture).ToString(dddd)
this will give you day name

Hello, I want to filter the entire table day by day: 1st to extract all data for 06.03 , 2nd all data for 07.03 etc can I divide the date and time for the whole table without using for each? The goal is then to be able to filter the table day by day, knowing that 06.03.2023=Monday, 07.03.2023 = Tuesday, etc.


Can you try the following sample?

arrDr = dt.AsEnumerable.Where(Function(r) DateTime.ParseExact(System.Text.RegularExpressions.Regex.Match(r(1).ToString,"^\d+\.\d+\.\d+").Value,"dd.MM.yyyy",System.Globalization.CultureInfo.InvariantCulture).DayOfWeek=DayOfWeek.Monday).ToArray (9.1 KB)


1 Like

It works, but it’s not what I need. I’ll try to explain. Wedding in the week I get the table in question. The goal is to be able to convert the date in column “B” in the format “dd.MM.yyyy” and keep the table.

Hey @pl.rusinov

Excel (15.2 KB)
Hope this helps


How about the following?

filteredDt = dt.AsEnumerable.Select(Function(r) dt.Clone.LoadDataRow({r(0),System.Text.RegularExpressions.Regex.Match(r(1).ToString,"^\d+\.\d+\.\d+").Value},False)).CopyToDataTable (15.0 KB)