Want to solve programming problems and get paid for it? If that sounds interesting to you then contact us.
I had this issue due to a silly mistake.
For e.g.:
September 31, 2015 non existing date.
EXEC dbo.SearchByDateRange @Start = '20150901' , @End = '20150931'
So this fails and will give error message:
Error converting data type varchar to datetime.
To fix it just input a valid date:
EXEC dbo.SearchByDateRange @Start = '20150901' , @End = '20150930'
It will executes just fine and your issue will be fixed .