In LINQ Query convert the string to datetime and check with today's date

后端 未结 6 1442
情歌与酒
情歌与酒 2021-01-24 17:24

In Table, DueDate data type is varchar. Now I want to check the due date with today\'s date

 var query = (from o in db.Order_Reports
              where Convert.         


        
6条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-24 18:17

    You could use String.Compare.

    var query = from o in db.Order_Reports
                where String.Compare(o.ReportDueDateTime, Now.ToString()) > 0
                select o;
    

提交回复
热议问题