I have found a linq command in the forum which gives me the last date, this works great. What is new is that I want the last date, which is after today. Meaning if the oldest date is < than today, then take the next date after today. who can help me with this?
for example:
|01.06.2023|45078| = last
|21.08.2023|45159| = Today
|24.08.2023|45162| = need
|11.11.2023|45241|
|24.12.2023|45284|
(From row In DtForDate Order By DateTime.ParseExact(row.Item(“Liefertermin”).ToString, “dd.MM.yyyy”,
System.Globalization.CultureInfo.InvariantCulture) Descending Select row).Last()(“Liefertermin”).ToString
(From row In DtForDate
Where DateTime.ParseExact(row.Item(“Liefertermin”).ToString, “dd.MM.yyyy”, System.Globalization.CultureInfo.InvariantCulture) > today
Order By DateTime.ParseExact(row.Item(“Liefertermin”).ToString, “dd.MM.yyyy”, System.Globalization.CultureInfo.InvariantCulture)
Select DateTime.ParseExact(row.Item(“Liefertermin”).ToString, “dd.MM.yyyy”, System.Globalization.CultureInfo.InvariantCulture)).FirstOrDefault()