I am working on a website in asp.net. I am getting a date from a web page and then depending on the user input I want to get results from SQL Server database (using stored p
If you only want compare with day level and ignoring the hours part, you can use DateDiff function. Pass d or DAY to interval parameter of DateDiff
For example:
DECLARE @sDate VARCHAR(100)='2016-10-08'
IF ISDATE(@sDate)=1
BEGIN
select *
from table
where datediff(d,acceptedDate,@sDate)=0 --same day
END
ELSE
PRINT 'Invalid date format!'