Filtering Datatable Date Help

Hello,
I have a datatable and I need to filter it to show the dates between specific dates: lastFriday, SixWkFri (variables). It seems nothing I have tried, works. I am currently using an assign, for each and invoke method to remove the rows from the datatable. I just need the result to be my filtered datatable with the results. the filterdatatable activity does not work. Can someone please help? below are screenshots of my activities.
ELogDT= datatable
I tried with both column name and storing column name as a variable. the last pic is of the datatable results. It goes from having 1681 rows to 0. I have also flipped the sign and get the same.



image

HI,

Can you share content of input datatable and expected output?

Regards,

this is the original table. I hid some columns so you can see the week ending date.

I want to filter it to only have those dates equal to or between the variables. for instance, lastFriday = 08/19/2022 and SixWksFriday = 07/15/2022

so filtered it would be:

sorry it left off a row:

HI,

Can you try the following sample?

arrDr = dt.AsEnumerable.Where(Function(r) DateTime.Parse(r("Week Ending Date").ToString)<=lastFriday AndAlso DateTime.Parse(r("Week Ending Date").ToString)>sixWkFriday).ToArray

Sample20220825-2.zip (3.0 KB)

Regards,

that works. Thanks for you help!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.