I have a table with two separate columns for date and time (SQL Server 2008).
I am trying to get the data between 1 minute before current time and 1 minute after current current time in my asp.net MVC (C#) application.
I have tried to use the where condition as:
ce.Start_Date.Add(ce.Start_Time) >= _currDateTime.AddMinutes(-1) &&
ce.Start_Date.Add(ce.Start_Time) <= _currDateTime.AddMinutes(1)
But from the above where condition, it throws an error:
The datepart millisecond is not supported by
date function dateadd for data type date.
How can I correct/rectify this error?