Can you try the below: Assign - foreignAP_DT = foreignAP_DT.AsEnumerable().Where(Function (drRow) DateTime.Parse(drRow.Item("Due Date").ToString, Nothing, Nothing) <= startDate).CopyToDataTable
This will convert the row value of Due Date into a date, before performing the comparison.
Worth noting, you likely wants to incorporate an If beforehand, to check items exist: If - foreignAP_DT.AsEnumerable().Any(Function (drRow) DateTime.Parse(drRow.Item("Due Date").ToString, Nothing, Nothing) <= startDate)) Then...
@Mr_JDavey Thanks for the response. I believe I found the issue when trying your code. The cause is because some dates that were read from the excel are strings so the comparison gave an error.