I want to keep the data which has "now.AddDays(-1).ToString(“d-mmm-yy”)” in Date
DTCase.AsEnumerable.Where(Function(r) If(DateTime.TryParseExact(r("Date"),"d-mmmm-yy",System.Globalization.CultureInfo.InvariantCulture),DateTime.ParseExact(r("Date"),"d-mmmm-yy",System.Globalization.CultureInfo.InvariantCulture) = now.AddDays(-1).ToString("d-mmmm-yy"), False)).ToArray
Sample date : Apr 5, 2020
Value = now.AddDays(-1).ToString(“MMM d, yyyy”)
Sample date : Apr 05, 2020
Value = now.AddDays(-1).ToString(“MMM dd, yyyy”)
I would suggest changing the operation to greater than or less than
First condition to use
“Date” is greater than value Now.AddDays(-2)
“Date” is less than value Now
What if I want to get the data after last 2 days.
I tried this but its not working
I’ve tried it. But still not working
Ok, then try my LINQ.
Customize it according to your needs
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.