Filter Data Table Won't Filter Date Range

I created a data table with a column labeled “Date.” This data table was originally read from an Excel file. The dates are in the format mm/dd/yyyy. I assigned the date values based on input dialog from the user. The data table is pasted onto an Excel sheet at the end of my entire workflow. Everything is pasted correctly except that the dates are not filtered at all. Here are the screenshots of what I did.

Any tips on how to properly filter the dates are much appreciated. I’m filtering from the last week of March to the first week of April.

Here is my sequence for altering the data table.

Here is the right side of my assign activity. The expression is the same for end date other than that it uses ‘StartDate’ instead of ‘EndDate.’

Here is the filter configuration:

Hi,

It depends Type of Date in “Date” Column. If it’s String, the above won’t work.
So, can you try the following LINQ expression?

 arrDr = HourLog_DataTable.AsEnumerable.Where(Function(r) CDate(r("Date"))>=NewStartDate AndAlso CDate(r("Date"))<= NewEndDate).ToArray()

if arrDr has one or more rows,

Filtered_dt = arrDr.CopyToDataTable()

Else

Filtered_dt = HourLog_DataTable.Clone

Note : arrDr is DataRow array type.

Regards,

Thank you for your response. For some reason, it is still giving me an error. I’m very new to Studio, so I want to confirm a few things. Do I need to reference something else other than ‘r’ in the expression you provided? Also, do I need to replace my entire filter sequence with what you provided, or do I combine them?

Hi,

The above expression will work as it.
Can you share what error do you have? The above expression will throw exception if there is non-datetime data including empty in “Date” column.

Regards,