Filter Data Table DayOfWeek

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

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.

Hi,

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

Sample20230314-6L.zip (9.1 KB)

Regards,

1 Like

HI
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
image

Excel Foum.zip (15.2 KB)
Hope this helps
Cheers.

Hi,

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

Sample20230314-6Lv2.zip (15.0 KB)

Regards,