How to sort data tables based on the 'Date Column' in UiPath

I have a data table with multiple columns but I need to sort this data table based on the “Order Month” column, and this column contains only the date, and I need to sort this data table in Descending Order,

How we can sort this data table, let me tell you.

Ans:- First We will convert this column String to Date time data type and then we can compare greater and lower dates, and we can assign it in the same data table or we can create a new data table type variable.

Dt_DataTable = (From r In Dt_DataTable.AsEnumerable Order By DateTime.ParseExact(r("Order Month”).ToString.Trim,“MMM-yy”, System.Globalization.CultureInfo.InvariantCulture).Date Descending
Select r).CopyToDataTable

Final Result :star_struck: :robot:

Happy Automation :robot:

1 Like

really helped in my project