Hi @sudhir bharti ,
Welcome to the Microsoft TSQL Q&A Forum!
The date format you provided is not the SQL Server standard date format.Can the format of the inserted date be changed?
If it can be changed,please refer to:
create table #test (ToFromDateTimeSS varchar(25))
insert into #test values('01/25/2021 10:31:25 AM'),('01/25/2021 9:58:24 AM'),('01/25/2021 9:58:22 AM')
,('01/25/2021 9:57:14 AM'),('01/25/2021 9:57:12 AM')
select * from #test
order by convert(datetime,ToFromDateTimeSS) desc
Output:
If you have any question, please feel free to let me know.
If the response is helpful, please click "Accept Answer" and upvote it.
Regards
Echo
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.