我有日期和時間(SQL Server 2008中)兩個單獨列的表從指定的日期和時間範圍之間的數據庫獲取數據。使用LINQ-SQL
我想目前的時間和我的asp.net MVC(C#)應用當前當前時間在1分鐘前1分鐘搞定之間的數據。
我曾嘗試使用WHERE條件爲:
ce.Start_Date.Add(ce.Start_Time) >= _currDateTime.AddMinutes(-1) &&
ce.Start_Date.Add(ce.Start_Time) <= _currDateTime.AddMinutes(1)
但是從上面的where條件,它拋出一個錯誤:
The datepart millisecond is not supported by
date function dateadd for data type date.
我可以糾正/糾正如何這個錯誤?
我已經嘗試了上述條件也和它不允許在添加ce.Start_Date.Add(ce.Start_Time)where條件,甚至讓使用 – Prasad