Quick Guidance Please

lets rewrite to Query syntax and do checking on month instead of string base

(From d in dt.AsEnumerable()
let dp = DateTime.ParseExact(d("Data validarii CN").toString.Trim,“yyyy-MM-dd HH:mm:ss”,CultureInfo.InvariantCulture)
Where dp.Month = now.AddMonths(-1).Month
Select r=d).CopyToDataTable

But when your data is away from last month so result is empty

Also have alook here:

1 Like