Sort a data table in descending order based on Date time

Hi All,

I have the data table as below:

DateTime (Type: DateTime)| FileName (Type: String)

04/05/2022 13:02:00 | abc.xlsx

04/05/2022 15:39:00 | xyx.xlsx

04/05/2022 15:28:00 | mnm.xlsx

04/05/2022 13:15:00 | kmn.xlsx

I need to format this is the descending order. Can someone help me with this?


have a try at following:

dtOrdered =

(From d in dtData.AsEnumerable
Order by CDate(d("DateTime").toString.Trim) DESCENDING
Select r = d).CopyToDataTable
1 Like

Thanks a lot. :grinning:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.