How to get the older dates than the current month

Hi @Marian_B ,

Could you Check the below Expression :

Input_DT.AsEnumerable.Where(Function(x)CDate(x("Date").ToString).Month<Now.Month).ToArray

Also you would need to follow the below Post to handle the Errors when you convert directly the Filtered Datarows into Datatable.

There might be additional conditions that need to be added if there are multiple date formats/Empty values or change the CDate() to DateTime.ParseExact() to get the appropriate results.

Let us know if the expression doesn’t work, we can change the expression according to the results or the Error Message you receive.

1 Like