Hello all,
I have an excel file in which there is a column with dates.
I would neet to get a table with the condition that the month of the dates columns is bigger than current month using linq.
Do you know how could I do it?
Thanks!
Hello all,
I have an excel file in which there is a column with dates.
I would neet to get a table with the condition that the month of the dates columns is bigger than current month using linq.
Do you know how could I do it?
Thanks!
Hi @Angel_Llull, I’ve used LINQ as per your requirement. Please find the below query:
InputDT.AsEnumerable().Where(Function(row) CInt(DateTime.ParseExact(row(“Date”).toString(), “dd.MM.yyyy”, Globalization.CultureInfo.InvariantCulture).ToString(“MM”))>CInt(DateTime.ParseExact(now().toString(), “MM/dd/yyyy HH:mm:ss”, Globalization.CultureInfo.InvariantCulture).ToString(“MM”))).CopyToDataTable
Let me know if it works.
CheckMonthTest.zip (8.9 KB)