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 procedures).
Problem is that I am getting date only from UI in this format 2016-10-08
which is of type string. But in the database, I have a column which is of type datetime
in this format 2016-10-08 17:38:00.000
.
I am using this query to search but it does not work.
select *
from table
where acceptedDate like @sDate+ '%';
where sDate
is input parameter for stored procedure. Please help. thanks