Date.xlsx (10.2 KB)
I have this excel sheet. Now based upon input, I need to fetch closeset previous date.
one expert suggested me this
dt.AsEnumerable.Select(Function(r) DateTime.ParseExact(r(“Column”).ToString,“dd-MM-yyyy”,System.Globalization.CultureInfo.InvariantCulture)).OrderBy(Function(d) d).Where(Function(d) d<targetDate).Last.ToString(“dd-MM-yyyy”)
But this is not working because when reading data from excel, I am getting date in this format like 16-06-2022 00:00:00.
I pass input date as 25-06-2022, it should give me 3rd row that is “23-06-2022” as output.
Experts please help me