I want to do something like this using EntityFramework entity-sql query. I am using .Net3.5
StringBuilder query = new StringBuilder(@"
Select VALUE o
From ordercontainer.report as o
WHERE o.xId = @xId
");
query.Append(" && datediff(hh,getdate(),o.StatusChangeTimeStamp) >= @DurationInHours");
Use this method in .NET 3.5
System.Data.Linq.SqlClient.SqlMethods.DateDiffHour(startDate, endDate);
This class contains several more Methods that can be used in .NET3.5
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.